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

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

From
DSDragan Simic <dsimic@manjaro.org>
Date
Mar 20, 2024, 07:23 UTC
Message-ID
<c4f0e7311edce5d4ed4a55f290de9eaf@manjaro.org>
In-Reply-To
<xmqqttl1js1o.fsf@gitster.g>
On 2024-03-20 08:12, Junio C Hamano wrote:
Show 12 quoted lines
> Dragan Simic <dsimic@manjaro.org> writes:
> 
>>  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 whitespace characters after 'name =', the remainder of the
>>  line after the first comment character '#' or ';', and trailing
>> +whitespace characters of the line are discarded unless they are 
>> enclosed
>> +in double quotes.
> 
> Can we directly tighten the "trailing..." part, instead of having to
> add an extra long sentence ...
Makes sense, to make it less convoluted.
Show 7 quoted lines
>> +The discarding of the trailing whitespace characters
>> +applies regardless of the discarding of the portion of the line after
>> +the first comment character.
> 
> ... like this as an attempt to clarify?
> 
>     Leading whitespace characters before and after 'name =', and the

Hmm, "leading whitespace" and "after" don't go very well together. Such a construct seems a bit confusing, because it implies there's something else after, which the leading whitespace refers to, which may or may not be easily understandable to the users.

I'll think about how to rephrase this a bit better.
Show 9 quoted lines
>     remainder of the line after the first comment character '#' or
>     ';', are removed, and then trailing whitespace characters at the
>     end of the line are discarded.
> 
> By the way, if a run of whitespace characters are enclosed in double
> quotes, they cannot be trailing at the end of the line, as the
> closing double quote is not a whitespace character, so it is out of
> place to talk about quoted string in the context of trailing blank
> removal.  The unquoting would want to be discussed separately.
I'll think about this as well.
>>  Inside double quotes, double quote `"` and backslash `\` characters
>>  must be escaped: use `\"` for `"` and `\\` for `\`.
> 
> Thanks for working on this topic.
Thank you for your highly detailed reviews!
Previous: Junio C HamanoNext: Junio C Hamano
Message 14 of 16 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 18, 2024
  2. 1/4 config: minor addition of whitespaceDragan Simic, Mar 18, 2024
  3. Junio C HamanoMar 20, 2024
  4. Dragan SimicMar 20, 2024
  5. 2/4 config: really keep value-internal whitespace verbatimDragan Simic, Mar 18, 2024
  6. 3/4 t1300: add more tests for whitespace and inline commentsDragan Simic, Mar 18, 2024
  7. Junio C HamanoMar 20, 2024
  8. Dragan SimicMar 20, 2024
  9. Dragan SimicMar 20, 2024
  10. Junio C HamanoMar 20, 2024
  11. Dragan SimicMar 20, 2024
  12. 4/4 config.txt: describe handling of whitespace furtherDragan Simic, Mar 18, 2024
  13. Junio C HamanoMar 20, 2024
  14. Dragan SimicMar 20, 2024
  15. Junio C HamanoMar 20, 2024
  16. Dragan SimicMar 20, 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.