Skip to content

Commit

Permalink
help: interpret help.autocorrect=1 as "immediate" rather than 0.1s
Browse files Browse the repository at this point in the history
Many people confusingly set the "help.autocorrect" setting to 1 believing it
to be a boolean that turns on the autocorrect feature rather than an integer
value of deciseconds wait time. Since it's impossible for a human being to
react this quickly, the help message stating that it's waiting for 0.1s
before continuing becomes confusingly comical.

This patch simply interprets a "1" value as the same as the "immedate"
autocorrect setting, which makes it skip the 0.1s and simply say that it's
running the command, which is almost certainly what everyone setting it to
that value is actually trying to do.

Signed-off-by: Scott Chacon <schacon@gmail.com>
  • Loading branch information
schacon committed Jan 8, 2025
1 parent 1465006 commit dbda79c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion help.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ static int git_unknown_cmd_config(const char *var, const char *value,
return config_error_nonbool(var);
if (!strcmp(value, "never")) {
cfg->autocorrect = AUTOCORRECT_NEVER;
} else if (!strcmp(value, "immediate")) {
} else if (!strcmp(value, "immediate") || !strcmp(value, "1")) {
cfg->autocorrect = AUTOCORRECT_IMMEDIATELY;
} else if (!strcmp(value, "prompt")) {
cfg->autocorrect = AUTOCORRECT_PROMPT;
Expand Down

0 comments on commit dbda79c

Please sign in to comment.