Re: [PATCH v2] config: add --comment option to add a comment
- From
- Dragan Simic <dsimic@manjaro.org>
- Date
- Mar 12, 2024, 02:27 UTC
- Message-ID
- <41c7cfa73dc0b4e7345ba788c45beead@manjaro.org>
- In-Reply-To
- <0b9a01da73e8$b7cd8f80$2768ae80$@nexbridge.com>
On 2024-03-11 20:17, rsbecker@nexbridge.com wrote:
Show 13 quoted lines
> My take would be that all whitespace is ignored, but if you want a tab > or other character in a value, be explicit about it: > > variable = "value\ts" # comment > > where all whitespace and comments are dropped from the parse to be > functionally equivalent to > > variable=value(TAB)s > > when processing. Implicit quoting arbitrary whitespace can be > interpreted in an ambiguous way. That's basically what the C parser > does.
Oh, I fully agree, but I'm afraid that would be a breaking change at this point. Perhaps numerous configuration values in the field already use the current (mis)behavior of the value parser in config.c.
I think the only right thing to do at this point is to document it properly and correctly in the git-config(1) manual page. A bit later I'll prepare and send a patch that does it.