git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 5/5] config.txt: describe handling of whitespace further

From
DSDragan Simic <dsimic@manjaro.org>
Date
Mar 17, 2024, 03:48 UTC
Message-ID
<041e0bb6fd72d12318130e7010a75dc8321e2d34.1710646998.git.dsimic@manjaro.org>
In-Reply-To
<cover.1710646998.git.dsimic@manjaro.org>

Make it more clear what the whitespace characters are in the context of git configuration files, and improve the description of the trailing whitespace handling a bit.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
---
Notes:
    Changes in v2:
        - No changes were introduced
 Documentation/config.txt | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 782c2bab906c..20f3300dc706 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
@@ -64,12 +65,14 @@ 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
+ending it with a `\`; the backslash and the end-of-line are stripped.
+Leading whitespace characters 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.
+whitespace characters of the line are discarded unless they are enclosed
+in double quotes.  The discarding of the trailing whitespace characters
+applies regardless of the discarding of the portion of the line after
+the first comment character.  Internal whitespace characters within the
+value are retained verbatim.
 
 Inside double quotes, double quote `"` and backslash `\` characters
 must be escaped: use `\"` for `"` and `\\` for `\`.
Previous: Dragan Simic
Message 20 of 20 in “Fix a bug in configuration parsing, and improve tests and documentation”
  1. 0/5 Fix a bug in configuration parsing, and improve tests and documentationDragan Simic, Mar 17, 2024
  2. 1/5 config: minor addition of whitespaceDragan Simic, Mar 17, 2024
  3. 2/5 config: really keep value-internal whitespace verbatimDragan Simic, Mar 17, 2024
  4. 3/5 test: introduce new x_to_tab() helper functionDragan Simic, Mar 17, 2024
  5. Eric SunshineMar 17, 2024
  6. Dragan SimicMar 17, 2024
  7. 4/5 t1300: add more tests for whitespace and inline commentsDragan Simic, Mar 17, 2024
  8. Eric SunshineMar 17, 2024
  9. Eric SunshineMar 17, 2024
  10. Dragan SimicMar 17, 2024
  11. Eric SunshineMar 18, 2024
  12. Junio C HamanoMar 18, 2024
  13. Dragan SimicMar 18, 2024
  14. Eric SunshineMar 18, 2024
  15. Dragan SimicMar 18, 2024
  16. Dragan SimicMar 18, 2024
  17. Eric SunshineMar 18, 2024
  18. Junio C HamanoMar 18, 2024
  19. Dragan SimicMar 18, 2024
  20. 5/5 config.txt: describe handling of whitespace furtherDragan Simic, Mar 17, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.