Re: [PATCH v4] help.c: expand options for help.autocorrect
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 18, 2020, 18:15 UTC
- Message-ID
- <xmqqwnyi1qgs.fsf@gitster.c.googlers.com>
- In-Reply-To
- <xmqq1rgq35my.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 19 quoted lines
> Drew DeVault <sir@cmpwn.com> writes: > >> Some users would prefer to never suggest corrections at all. > > Here is how I would have phrased it. > > Key points: > > - The log message starts with the description of the current state > of the system and introduces the problem the patch tries to > solve. > > - Then gives orders to the codebase to "be like so" > > - The addition of "never" is the primary change to solve the stated > problem. "immediate" is not the essential part but is merely > adding a synonym while we are in the vicinity. > > Thanks.
Also, I think we would want _some_ test, as the base form of help.autocorrect is already tested. Perhaps something like this.
t/t9003-help-autocorrect.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git c/t/t9003-help-autocorrect.sh w/t/t9003-help-autocorrect.sh index b1c7919c4a..8f1035c3c2 100755 --- c/t/t9003-help-autocorrect.sh +++ w/t/t9003-help-autocorrect.sh @@ -49,4 +49,17 @@ test_expect_success 'autocorrect running commands' ' test_cmp expect actual ' +test_expect_success 'autocorrect can be declined altogether' ' + git config help.autocorrect never && + + test_must_fail git lfg 2>actual && + if test_have_prereq C_LOCALE_OUTPUT + then + : cannot test with poisoned i18n + else + grep "is not a git command" actual && + test_line_count = 1 actual + fi +' + test_done