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

Re: [PATCH v5 4/4] config.txt: describe handling of whitespace further

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 21, 2024, 06:22 UTC
Message-ID
<CAPig+cToaiCzj2XwNSeStx7p7ZPn7=a2nKZBFLwX12Uj=hJ7cw@mail.gmail.com>
In-Reply-To
<a75a5eb8793f4ae6eb6e7cf0e2fd017471fefd0e.1711001016.git.dsimic@manjaro.org>
On Thu, Mar 21, 2024 at 2:06 AM Dragan Simic <dsimic@manjaro.org> wrote:
Show 29 quoted lines
> Make it more clear what the whitespace characters are in the context of git
> configuration files, and significantly improve the description of the leading
> and trailing whitespace handling, especially how it works out together with
> the presence of inline comments.
>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Helped-by: Eric Sunshine <sunshine@sunshineco.com>
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
>     Changes in v5:
>         - Rewrote the description of whitespace character handling again,
>           to eliminate ambiguity, as suggested by Eric Sunshine [3][4]
>         - Extended the improvements to the following paragraph as well, to
>           tie it all together, and to make it less ambiguous how to include
>           leading and trailing whitespace characters into configuration
>           option values, if desired so
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> @@ -63,16 +64,17 @@ the variable is the boolean "true").
> +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 `\`.
Thanks. I find this discussion clearer than v4.
I don't have any further review comments on v5.
Previous: Dragan SimicNext: Dragan Simic
Message 6 of 9 in “Fix a bug in configuration parsing, and improve tests and documentation”
  1. 0/4 Fix a bug in configuration parsing, and improve tests and documentationDragan Simic, Mar 21, 2024
  2. 1/4 config: minor addition of whitespaceDragan Simic, Mar 21, 2024
  3. 2/4 config: really keep value-internal whitespace verbatimDragan Simic, Mar 21, 2024
  4. 3/4 t1300: add more tests for whitespace and inline commentsDragan Simic, Mar 21, 2024
  5. 4/4 config.txt: describe handling of whitespace furtherDragan Simic, Mar 21, 2024
  6. Eric SunshineMar 21, 2024
  7. Dragan SimicMar 21, 2024
  8. Junio C HamanoMar 21, 2024
  9. Dragan SimicMar 22, 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.