Re: [PATCH v2] add-patch: enforce only one-letter response to prompts
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 22, 2024, 16:23 UTC
- Message-ID
- <xmqqzfsh6cjf.fsf@gitster.g>
- In-Reply-To
- <fbb9c7d3e7c2129bc1526dfa5a8eca0c@manjaro.org>
Dragan Simic <dsimic@manjaro.org> writes:
Show 8 quoted lines
> Hello Junio, > > Please see my comments below. > > On 2024-05-22 01:20, Junio C Hamano wrote: >> In an "git add -p" session, especially when we are not using the > > s/In an/In a/
Good eyes.
> >> single-char mode, we may see 'qa' as a response to a prompt > > Perhaps s/single-char/single-character/
I shouldn't have been loose in the language. Rather, we should say "single key mode", as the knob to control the feature is the "interactive.singlekey" variable.
Show 7 quoted lines
>> + /* 'g' takes a hunk number, '/' takes a regexp */
>> + if (1 < s->answer.len && (ch != 'g' && ch != '/')) {
>
> To me, "s->answer.len > 1" would be much more readable, and
> I was surprised a bit to see the flipped variant. This made
> me curious; would you, please, let me know why do you prefer
> this form?"textual order should reflect actual order" (read CodingGuidelines).
For more backstory,
https://lore.kernel.org/git/?q=%22textual+order%22+%22actual+order%22
Thanks.