Re: [PATCH v4] help.c: expand options for help.autocorrect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Drew DeVault <sir@xxxxxxxxx> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux