mirror of
https://github.com/git/git.git
synced 2026-03-11 17:39:46 +01:00
autocorrect: rename AUTOCORRECT_SHOW to AUTOCORRECT_HINTONLY
AUTOCORRECT_SHOW is ambiguous. Its purpose is to show commands similar to the unknown one and take no other action. Rename it to fit the semantics. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
c8ac3d589a
commit
2a48e5668b
@@ -12,7 +12,7 @@ static enum autocorr_mode parse_autocorrect(const char *value)
|
||||
case 1:
|
||||
return AUTOCORRECT_IMMEDIATELY;
|
||||
case 0:
|
||||
return AUTOCORRECT_SHOW;
|
||||
return AUTOCORRECT_HINTONLY;
|
||||
default: /* other random text */
|
||||
break;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ static enum autocorr_mode parse_autocorrect(const char *value)
|
||||
else if (!strcmp(value, "immediate"))
|
||||
return AUTOCORRECT_IMMEDIATELY;
|
||||
else if (!strcmp(value, "show"))
|
||||
return AUTOCORRECT_SHOW;
|
||||
return AUTOCORRECT_HINTONLY;
|
||||
else
|
||||
return AUTOCORRECT_DELAY;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ void autocorr_resolve_config(const char *var, const char *value,
|
||||
conf->delay = git_config_int(var, value, ctx->kvi);
|
||||
|
||||
if (!conf->delay)
|
||||
conf->mode = AUTOCORRECT_SHOW;
|
||||
conf->mode = AUTOCORRECT_HINTONLY;
|
||||
else if (conf->delay <= 1)
|
||||
conf->mode = AUTOCORRECT_IMMEDIATELY;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
struct config_context;
|
||||
|
||||
enum autocorr_mode {
|
||||
AUTOCORRECT_SHOW,
|
||||
AUTOCORRECT_HINTONLY,
|
||||
AUTOCORRECT_NEVER,
|
||||
AUTOCORRECT_PROMPT,
|
||||
AUTOCORRECT_IMMEDIATELY,
|
||||
|
||||
2
help.c
2
help.c
@@ -674,7 +674,7 @@ char *help_unknown_cmd(const char *cmd)
|
||||
; /* still counting */
|
||||
}
|
||||
|
||||
if (cfg.autocorr.mode != AUTOCORRECT_SHOW && n == 1 &&
|
||||
if (cfg.autocorr.mode != AUTOCORRECT_HINTONLY && n == 1 &&
|
||||
SIMILAR_ENOUGH(best_similarity)) {
|
||||
char *assumed = xstrdup(main_cmds.names[0]->name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user