From 6cc7aa72e8c5722fcdc8c9714eb3b767e149fabe Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Wed, 15 Feb 2023 22:06:52 -0800 Subject: [PATCH] `config.md`: expand on equivalence of headers and dotted keys Now that we use headers to define `[template-aliases]`, I thought we should explain how they are also equivalent to dotted keys. Alternatively, we could rewrite them all in the dotted style, but it would look awkward. --- docs/config.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/config.md b/docs/config.md index 02b3c71eb..dbe3f7160 100644 --- a/docs/config.md +++ b/docs/config.md @@ -17,11 +17,19 @@ e.g. `user.name = "YOUR NAME"` is equivalent to: name = "YOUR NAME" ``` -Headings only need to be set once in the real config file but Jujutsu favors the -dotted style in these instructions, if only because it's easier to write down in -an unconfusing way. If you are confident with TOML then use whichever suits you -in your config. If you mix the styles, put the dotted keys before the first -heading. +For a more complicated example, + +```toml +[template-aliases] +"format_short_id(id)" = "id.shortest(12)" +``` + +is equivalent to `template-aliases."format_short_id(id)" = "id.shortest(12)"`. + +Jujutsu favors the dotted style in these instructions, if only because it's +easier to write down in an unconfusing way. If you are confident with TOML +then use whichever suits you in your config. If you mix dotted keys and headings, +**put the dotted keys before the first heading**. The other thing to remember is that the value of a setting (the part to the right of the `=` sign) should be surrounded in quotes if it's a string. That's