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 <marcnarc@xiplink.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Marc Branchaud committed Jun 21, 2017 at 09:57 UTC 968b1fe263f9dfec65be4598e4f0dd76f1692551
1 file changed +12 -6
help.c
+12 -6
@@ -386,12 +386,18 @@ const char *help_unknown_cmd(const char *cmd)
386 clean_cmdnames(&main_cmds);
387 fprintf_ln(stderr,
388 _("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);
401 sleep_millisec(autocorrect * 100);
402 }
403 return assumed;