summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorJean-Noel Avila <jn.avila@free.fr>2017-05-11 12:06:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-12 06:18:13 (GMT)
commit6c486862636be1fe2d5785451c52f5379b0bad24 (patch)
treefb66b6b06626b230f60f9bced8d4cc845a7b6dec /help.c
parent49800c940790cc7465d1b03e08d472ffd8684808 (diff)
downloadgit-6c486862636be1fe2d5785451c52f5379b0bad24.zip
git-6c486862636be1fe2d5785451c52f5379b0bad24.tar.gz
git-6c486862636be1fe2d5785451c52f5379b0bad24.tar.bz2
usability: don't ask questions if no reply is required
There has been a bug report by a corporate user that stated that "spelling mistake of stash followed by a yes prints character 'y' infinite times." This analysis was false. When the spelling of a command contains errors, the git program tries to help the user by providing candidates which are close to the unexisting command. E.g Git prints the following: git: 'stahs' is not a git command. See 'git --help'. Did you mean this? stash and then exits. The problem with this hint is that it is not formally indicated as an hint and the user is in fact encouraged to reply to the question, whereas the Git command is already finished. The user was unlucky enough that it was the command he was looking for, and replied "yes" on the command line, effectively launching the `yes` program. The initial error is that the Git programs, when launched in command-line mode (without interaction) must not ask questions, because these questions would normally require a user input as a reply that they won't handle indeed. That's a source of confusion on UX level. To improve the general usability of the Git suite, the following rule was applied: if the sentence * appears in a non-interactive session * is printed last before exit * is a question addressing the user ("you") the sentence is turned into affirmative and proposes the option. The basic rewording of the question sentences has been extended to other spots found in the source. Requested at https://github.com/git/git-scm.com/issues/999 by rpai1 Signed-off-by: Jean-Noel Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
-rw-r--r--help.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/help.c b/help.c
index bc6cd19..a07f01e 100644
--- a/help.c
+++ b/help.c
@@ -411,8 +411,8 @@ const char *help_unknown_cmd(const char *cmd)
if (SIMILAR_ENOUGH(best_similarity)) {
fprintf_ln(stderr,
- Q_("\nDid you mean this?",
- "\nDid you mean one of these?",
+ Q_("\nThe most similar command is",
+ "\nThe most similar commands are",
n));
for (i = 0; i < n; i++)