Re: [PATCH v2] config: add --comment option to add a comment
- From
- Dragan Simic <dsimic@manjaro.org>
- Date
- Mar 11, 2024, 18:55 UTC
- Message-ID
- <52cbdb9d1cbdb254dfdac467711becbf@manjaro.org>
- In-Reply-To
- <9166fa83-4ed5-41fd-83f7-337fd524d0e2@seichter.de>
On 2024-03-11 19:16, Ralph Seichter wrote:
Show 11 quoted lines
> * Junio C Hamano: > >> For readability, you probably would want to have a SP before the >> given string, i.e., >> >> variable = "value" # message comes here > > If the user wants a whitespace after the #, they can add it in the > comment using quoting, e.g. --comment " message comes here". I don't > think it is necessary to enforce the extra SP, because it is not > syntactically required. Besides, readability is quite subjective.
Perhaps that should be documented, so the users know what to expect and how to ensure extra spacing, if they desire so.
Show 9 quoted lines
>>> The implementation ensures that a # character is always >>> prepended to the provided comment string, and that the >> >> It is unclear what happens when a user gives comment that already >> has the comment introducer, e.g., --comment="# this is comment". > > Unclear? ;-) I wrote "a # character is always prepended to the > provided comment string", and that is what happens. The current > implementation is meant to be safe, not fancy.
Perhaps that should also be documented, to avoid the "##" sequences from occurring unexpectedly.