diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-04-01 20:21:34 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-01 20:21:34 (GMT) |
commit | 521df686e5a5d445e03280f48df966b77e23f160 (patch) | |
tree | fbd8b5eb9ef2b57c660aaa6ad9b8e799ec1530d0 /Documentation | |
parent | a031815a7df317a4387151b1f4af1c85834458b1 (diff) | |
parent | e6895c3f971dc4d60f7a9fac6ef41a6593a37ba9 (diff) | |
download | git-521df686e5a5d445e03280f48df966b77e23f160.zip git-521df686e5a5d445e03280f48df966b77e23f160.tar.gz git-521df686e5a5d445e03280f48df966b77e23f160.tar.bz2 |
Merge branch 'ds/config-internal-whitespace-fix'
"git config" corrupted literal HT characters written in the
configuration file as part of a value, which has been corrected.
* ds/config-internal-whitespace-fix:
config.txt: describe handling of whitespace further
t1300: add more tests for whitespace and inline comments
config: really keep value-internal whitespace verbatim
config: minor addition of whitespace
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config.txt | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 782c2ba..70b448b 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -22,9 +22,10 @@ multivalued. Syntax ~~~~~~ -The syntax is fairly flexible and permissive; whitespaces are mostly -ignored. The '#' and ';' characters begin comments to the end of line, -blank lines are ignored. +The syntax is fairly flexible and permissive. Whitespace characters, +which in this context are the space character (SP) and the horizontal +tabulation (HT), are mostly ignored. The '#' and ';' characters begin +comments to the end of line. Blank lines are ignored. The file consists of sections and variables. A section begins with the name of the section in square brackets and continues until the next @@ -63,16 +64,17 @@ the variable is the boolean "true"). The variable names are case-insensitive, allow only alphanumeric characters and `-`, and must start with an alphabetic character. -A line that defines a value can be continued to the next line by -ending it with a `\`; the backslash and the end-of-line are -stripped. Leading whitespaces after 'name =', the remainder of the -line after the first comment character '#' or ';', and trailing -whitespaces of the line are discarded unless they are enclosed in -double quotes. Internal whitespaces within the value are retained -verbatim. - -Inside double quotes, double quote `"` and backslash `\` characters -must be escaped: use `\"` for `"` and `\\` for `\`. +Whitespace characters surrounding `name`, `=` and `value` are discarded. +Internal whitespace characters within 'value' are retained verbatim. +Comments starting with either `#` or `;` and extending to the end of line +are discarded. A line that defines a value can be continued to the next +line by ending it with a backslash (`\`); the backslash and the end-of-line +characters are discarded. + +If `value` needs to contain leading or trailing whitespace characters, +it must be enclosed in double quotation marks (`"`). Inside double quotation +marks, double quote (`"`) and backslash (`\`) characters must be escaped: +use `\"` for `"` and `\\` for `\`. The following escape sequences (beside `\"` and `\\`) are recognized: `\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB) |