Skip to content

Commit 968b1fe

Browse files
marcnarcgitster
authored andcommitted
auto-correct: tweak phrasing
When help.autoCorrect is enabled, an invalid git command prints a warning and a continuation message, which differs depending on whether or not the value of help.autoCorrect is positive or negative. With help.autoCorrect = 15: WARNING: You called a Git command named 'lgo', which does not exist. Continuing under the assumption that you meant 'log' in 1.5 seconds automatically... With help.autoCorrect < 0: WARNING: You called a Git command named 'lgo', which does not exist. Continuing under the assumption that you meant 'log' The continuation message's phrasing is awkward. This commit cleans it up. As a bonus, we now use full-sentence strings which make translation easier. With help.autoCorrect = 15: WARNING: You called a Git command named 'lgo', which does not exist. Continuing in 1.5 seconds, assuming that you meant 'log'. With help.autoCorrect < 0: WARNING: You called a Git command named 'lgo', which does not exist. Continuing under the assumption that you meant 'log'. Signed-off-by: Marc Branchaud <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 840ed14 commit 968b1fe

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

help.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,18 @@ const char *help_unknown_cmd(const char *cmd)
386386
clean_cmdnames(&main_cmds);
387387
fprintf_ln(stderr,
388388
_("WARNING: You called a Git command named '%s', "
389-
"which does not exist.\n"
390-
"Continuing under the assumption that you meant '%s'"),
391-
cmd, assumed);
392-
if (autocorrect > 0) {
393-
fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
394-
(float)autocorrect/10.0);
389+
"which does not exist."),
390+
cmd);
391+
if (autocorrect < 0)
392+
fprintf_ln(stderr,
393+
_("Continuing under the assumption that "
394+
"you meant '%s'."),
395+
assumed);
396+
else {
397+
fprintf_ln(stderr,
398+
_("Continuing in %0.1f seconds, "
399+
"assuming that you meant '%s'."),
400+
(float)autocorrect/10.0, assumed);
395401
sleep_millisec(autocorrect * 100);
396402
}
397403
return assumed;

0 commit comments

Comments
 (0)