From: Junio C Hamano <gitster@pobox.com>
To: Drew DeVault <sir@cmpwn.com>
Cc: git@vger.kernel.org, lanodan <contact+git@hacktivis.me>
Subject: Re: [PATCH v4] help.c: expand options for help.autocorrect
Date: Wed, 18 Nov 2020 10:15:31 -0800 [thread overview]
Message-ID: <xmqqwnyi1qgs.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <xmqq1rgq35my.fsf@gitster.c.googlers.com> (Junio C. Hamano's message of "Wed, 18 Nov 2020 10:02:29 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> 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
next prev parent reply other threads:[~2020-11-18 18:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 17:28 [PATCH v4] help.c: expand options for help.autocorrect Drew DeVault
2020-11-18 18:02 ` Junio C Hamano
2020-11-18 18:15 ` Junio C Hamano [this message]
2020-11-25 18:33 ` SZEDER Gábor
2020-11-25 20:49 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwnyi1qgs.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=contact+git@hacktivis.me \
--cc=git@vger.kernel.org \
--cc=sir@cmpwn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).