Skip to content

Commit e4542d8

Browse files
davvidgitster
authored andcommitted
help: add "show" as a valid configuration value
Add a literal value for showing the suggested autocorrection for consistency with the rest of the help.autocorrect options. Signed-off-by: David Aguilar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e21bf2c commit e4542d8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Documentation/config/help.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ help.autoCorrect::
1111
If git detects typos and can identify exactly one valid command similar
1212
to the error, git will try to suggest the correct command or even
1313
run the suggestion automatically. Possible config values are:
14-
- 0, "false", "off", "no": show the suggested command (default).
14+
- 0, "false", "off", "no", "show": show the suggested command (default).
1515
- 1, "true", "on", "yes", "immediate": run the suggested command
1616
immediately.
1717
- positive number > 1: run the suggested command after specified

help.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ static int parse_autocorrect(const char *value)
574574
return AUTOCORRECT_NEVER;
575575
if (!strcmp(value, "immediate"))
576576
return AUTOCORRECT_IMMEDIATELY;
577+
if (!strcmp(value, "show"))
578+
return AUTOCORRECT_SHOW;
577579

578580
return 0;
579581
}

t/t9003-help-autocorrect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
2828
test_cmp expect actual
2929
'
3030

31-
for show in false no off 0
31+
for show in false no off 0 show
3232
do
3333
test_expect_success 'autocorrect showing candidates' '
3434
git config help.autocorrect $show &&

0 commit comments

Comments
 (0)