Re: [PATCH 3/4] format-patch: new --resend option for adding "RESEND" to patch subjects
- From
- Dragan Simic <dsimic@manjaro.org>
- Date
- Apr 18, 2024, 03:12 UTC
- Message-ID
- <84dcb80be916f85cbb6a4b99aea0d76b@manjaro.org>
- In-Reply-To
- <19d5f3d4c99fc1da24c80ac2a9ee8bf8@manjaro.org>
On 2024-04-17 23:09, Dragan Simic wrote:
Show 14 quoted lines
> On 2024-04-17 23:03, Junio C Hamano wrote:
>> Dragan Simic <dsimic@manjaro.org> writes:
>>
>>> With all due respect, "--rfc=WIP" looks like a kludge, simply
>>> because "--rfc" should, IIUC, be some kind of a fixed shorthand.
>>
>> I wouldn't use "should" there. In any case, we are not going to add
>> unbounded number of --wip, --resend, etc., on top of what we have
>> already. Introducing --something={WIP,RESEND,RFC,HACK,...} and
>> deprecating --rfc is not something I would object to, though.
>
> Good to know, thanks. I'll drop the patches that add "--resend"
> as a new command-line option, and I'll think a bit about the solution
> you described as acceptable.How about introducing "--label=<string>" as the new option, where "<string>" could also contain '$' as the last character, which would get stripped while indicating that the label is to treated as a (sub)suffix, instead of as a (sub)prefix.
For example, "--label=RFC" would be equal to the current "--rfc" (which would also become deprecated), producing "[RFC PATCH]", "--label=WIP" would produce "[WIP PATCH]", and "--label=RESEND$" would produce "[PATCH RESEND]".
Specifying '$' before a space character in a command line doesn't trigger parameter substitution or variable expansion by the shell, which means that using '$' as a "suffix anchor", as proposed above, would require no escaping or use of single quotation marks, making it more convenient to use.
Please, let me know your thoughts.