Merge branch 'ja/do-not-ask-needless-questions'
authorJunio C Hamano <gitster@pobox.com>
Mon, 29 May 2017 03:34:48 +0000 (12:34 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 May 2017 03:34:48 +0000 (12:34 +0900)
Git sometimes gives an advice in a rhetorical question that does
not require an answer, which can confuse new users and non native
speakers. Attempt to rephrase them.

* ja/do-not-ask-needless-questions:
git-filter-branch: be more direct in an error message
read-tree -m: make error message for merging 0 trees less smart aleck
usability: don't ask questions if no reply is required

Documentation/git-read-tree.txt
builtin/am.c
builtin/checkout.c
builtin/read-tree.c
git-filter-branch.sh
help.c
index ed9d63ef4a35fa5ba70b1b7f1ffd393f517be030..02576d8c0ae6008fc22d7c7c706909efde5856da 100644 (file)
@@ -137,7 +137,7 @@ Merging
 -------
 If `-m` is specified, 'git read-tree' can perform 3 kinds of
 merge, a single tree merge if only 1 tree is given, a
-fast-forward merge with 2 trees, or a 3-way merge if 3 trees are
+fast-forward merge with 2 trees, or a 3-way merge if 3 or more trees are
 provided.
 
 
index 8b218f9978628534ab47db80ab66f880553f4065..0f63dcab1610f111f19b513eea47089132c1c702 100644 (file)
@@ -1312,7 +1312,7 @@ static int parse_mail(struct am_state *state, const char *mail)
        }
 
        if (is_empty_file(am_path(state, "patch"))) {
-               printf_ln(_("Patch is empty. Was it split wrong?"));
+               printf_ln(_("Patch is empty."));
                die_user_resolve(state);
        }
 
@@ -1931,7 +1931,8 @@ static void am_resolve(struct am_state *state)
 
        if (unmerged_cache()) {
                printf_ln(_("You still have unmerged paths in your index.\n"
-                       "Did you forget to use 'git add'?"));
+                       "You should 'git add' each file with resolved conflicts to mark them as such.\n"
+                       "You might run `git rm` on a file to accept \"deleted by them\" for it."));
                die_user_resolve(state);
        }
 
index b6249a3a39eea52587c1515a1c54b4263e630a83..a6b2af39d3e881480193a38ff1ca3b65cdc55d94 100644 (file)
@@ -1289,9 +1289,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
                 * new_branch && argc > 1 will be caught later.
                 */
                if (opts.new_branch && argc == 1)
-                       die(_("Cannot update paths and switch to branch '%s' at the same time.\n"
-                             "Did you intend to checkout '%s' which can not be resolved as commit?"),
-                           opts.new_branch, argv[0]);
+                       die(_("'%s' is not a commit and a branch '%s' cannot be created from it"),
+                               argv[0], opts.new_branch);
 
                if (opts.force_detach)
                        die(_("git checkout: --detach does not take a path argument '%s'"),
index daf8d7795d5c7e120abacb9a1324869ba81eeb19..78d3193659e06b4969324153689f219f1cd1c1b3 100644 (file)
@@ -226,9 +226,10 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
                setup_work_tree();
 
        if (opts.merge) {
-               if (stage < 2)
-                       die("just how do you expect me to merge %d trees?", stage-1);
                switch (stage - 1) {
+               case 0:
+                       die("you must specify at least one tree to merge");
+                       break;
                case 1:
                        opts.fn = opts.prefix ? bind_merge : oneway_merge;
                        break;
index 2b8cdba157d9cd822acc88b7ec58cecda0149b85..aafaf708dace3493bee23370a6af9535a38e4c99 100755 (executable)
@@ -239,7 +239,7 @@ git rev-parse --no-flags --revs-only --symbolic-full-name \
 sed -e '/^^/d' "$tempdir"/raw-heads >"$tempdir"/heads
 
 test -s "$tempdir"/heads ||
-       die "Which ref do you want to rewrite?"
+       die "You must specify a ref to rewrite."
 
 GIT_INDEX_FILE="$(pwd)/../index"
 export GIT_INDEX_FILE
diff --git a/help.c b/help.c
index bc6cd19cf3a5e4300e32cbdd437b2d9231fd2d89..a07f01e6f9fc7895f27f3ee9a4a7e291ce995b0f 100644 (file)
--- 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++)