Documentation/config.txt: describe the structure first and then meaning

A line can be continued via a backquote-LF and can be chomped at a comment character. But that is not specific to string-typed values. It is common to all, just like unquoted leading and trailing whitespaces are stripped and inter-word spacing are retained. Move the description around and desribe these structural rules first, then introduce the double-quote facility as a way to override them, and finally mention various types of values. Note that these structural rules only apply to the value part of the configuration file. E.g. [aSection] \ name \ = value does not work, because the rules kick in only after seeing "name =". Both the original and the updated text are phrased in an awkward way by singling out the "value" part of the line because of this. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Mar 4, 2015 at 10:33 UTC ff5507ed2a34f0eb8c8d4f0bd300d2b786031aff
1 file changed +15 -16
Documentation/config.txt
+15 -16
@@ -59,32 +59,31 @@ is taken as 'name' and the variable is recognized as boolean "true".
59 The variable names are case-insensitive, allow only alphanumeric characters
60 and `-`, and must start with an alphabetic character.
61
62 -Leading and trailing whitespace in a variable value is discarded.
63 -Internal whitespace within a variable value is retained verbatim.
62 +A line that defines a value can be continued to the next line by
63 +ending it with a `\`; the backquote and the end-of-line are
64 +stripped. Leading whitespaces after 'name =', the remainder of the
65 +line after the first comment character '#' or ';', and trailing
66 +whitespaces of the line are discarded unless they are enclosed in
67 +double quotes. Internal whitespaces within the value are retained
68 +verbatim.
69
65 -The values following the equals sign in variable assign are all either
66 -a string, an integer, or a boolean. Boolean values may be given as yes/no,
67 -1/0, true/false or on/off. Case is not significant in boolean values, when
68 -converting value to the canonical form using '--bool' type specifier;
69 -'git config' will ensure that the output is "true" or "false".
70 -
71 -String values may be entirely or partially enclosed in double quotes.
72 -You need to enclose variable values in double quotes if you want to
73 -preserve leading or trailing whitespace, or if the variable value contains
74 -comment characters (i.e. it contains '#' or ';').
75 -Double quote `"` and backslash `\` characters in variable values must
76 -be escaped: use `\"` for `"` and `\\` for `\`.
70 +Inside double quotes, double quote `"` and backslash `\` characters
71 +must be escaped: use `\"` for `"` and `\\` for `\`.
72
73 The following escape sequences (beside `\"` and `\\`) are recognized:
74 `\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB)
75 and `\b` for backspace (BS). No other char escape sequence, nor octal
76 char sequences are valid.
77
83 -Variable values ending in a `\` are continued on the next line in the
84 -customary UNIX fashion.
78 +The values following the equals sign in variable assign are all either
79 +a string, an integer, or a boolean. Boolean values may be given as yes/no,
80 +1/0, true/false or on/off. Case is not significant in boolean values, when
81 +converting value to the canonical form using '--bool' type specifier;
82 +'git config' will ensure that the output is "true" or "false".
83
84 Some variables may require a special value format.
85
86 +
87 Includes
88 ~~~~~~~~
89