From: Dragan Simic Date: Mon, 11 Mar 2024 18:55:00 GMT Subject: Re: [PATCH v2] config: add --comment option to add a comment Message-ID: <52cbdb9d1cbdb254dfdac467711becbf@manjaro.org> In-Reply-To: <9166fa83-4ed5-41fd-83f7-337fd524d0e2@seichter.de> On 2024-03-11 19:16, Ralph Seichter wrote: > * 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. >>> 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.