Re: [PATCH v2] config: add --comment option to add a comment
- From
Ralph Seichter <github@seichter.de>
- Date
- Mar 12, 2024, 06:19 UTC
- Message-ID
- <cf21edb2-7681-42a9-8b58-beca5d04c179@seichter.de>
- In-Reply-To
- <9166fa83-4ed5-41fd-83f7-337fd524d0e2@seichter.de>
* Ralph Seichter:
> LF is a more interesting question. I haven't yet tried actively > introducing a linefeed. Does strbuf_addf() have any related > filtering logic?
I have now tried several times to inject a LF into a comment string, and did not manage to break the resulting config file. For example,
./git config --comment "foo\012bar" --add section.key value
leads to this entry:
[section]
key = value #foo\012barVariable expansion with LF="\012" and --comment "foo${LF}bar" did not introduce a linefeed either. Have you guys perhaps managed to create an invalid config file?
-Ralph