{"thread":{"id":"4024","subject":"[PATCH] Give the user a hint for how to continue in the case that git-am fails because it requires user intervention","startedAt":"2006-05-02T12:32:43Z","lastAt":"2006-05-02T12:32:43Z","messageCount":1,"participants":["Robert Shearman"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"19363","messageId":"4457516B.9010103@codeweavers.com","threadId":"4024","inReplyTo":null,"subject":"[PATCH] Give the user a hint for how to continue in the case that git-am fails because it requires user intervention","fromName":"Robert Shearman","fromEmail":"rob@codeweavers.com","sentAt":"2006-05-02T12:32:43Z","receivedAt":"2006-05-02T12:32:43Z","isPatch":true,"sender":{"key":"robertshearman@gmail.com","avatar":null},"body":"Give the user a hint for how to continue in the case that git-am fails \nbecause it requires user intervention.\n\nSigned-off-by: Robert Shearman <rob@codeweaves.com>\n\n---\n\nWhen git-am fails because it needs user intervention, the user may not \nknow what they need to do to continue with applying the mailbox. This \npatch gives them a hint to use git-am (as they may have started the \noperation from another tool, such as git-rebase). As the threeway, \ninteractive and dotest options are not persisted, the user may also \nforget to include them (or not realise at all that they should be \nincluded), so we should also tell the user to include these options if \nthey were orignally specified.\n\n  git-am.sh |   26 +++++++++++++++++++++++---\n  1 files changed, 23 insertions(+), 3 deletions(-)\n\n\n\nead48bae7157a30589791165b7b71208b68cf229\ndiff --git a/git-am.sh b/git-am.sh\nindex 872145b..507ae4d 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -14,6 +14,26 @@ stop_here () {\n     exit 1\n }\n \n+stop_here_user_resolve () {\n+    cmdline=$(basename $0)\n+    if test '' != \"$interactive\"\n+    then\n+        cmdline=\"$cmdline -i\"\n+    fi\n+    if test '' != \"$threeway\"\n+    then\n+        cmdline=\"$cmdline -3\"\n+    fi\n+    if test '.dotest' != \"$dotest\"\n+    then\n+        cmdline=\"$cmdline -d=$dotest\"\n+    fi\n+    echo \"When you have resolved this problem run \\\"$cmdline --resolved\\\".\"\n+    echo \"If you would prefer to skip this patch, instead run \\\"$cmdline --skip\\\".\"\n+\n+    stop_here $1\n+}\n+\n go_next () {\n \trm -f \"$dotest/$msgnum\" \"$dotest/msg\" \"$dotest/msg-clean\" \\\n \t\t\"$dotest/patch\" \"$dotest/info\"\n@@ -374,14 +394,14 @@ do\n \t\tif test '' = \"$changed\"\n \t\tthen\n \t\t\techo \"No changes - did you forget update-index?\"\n-\t\t\tstop_here $this\n+\t\t\tstop_here_user_resolve $this\n \t\tfi\n \t\tunmerged=$(git-ls-files -u)\n \t\tif test -n \"$unmerged\"\n \t\tthen\n \t\t\techo \"You still have unmerged paths in your index\"\n \t\t\techo \"did you forget update-index?\"\n-\t\t\tstop_here $this\n+\t\t\tstop_here_user_resolve $this\n \t\tfi\n \t\tapply_status=0\n \t\t;;\n@@ -407,7 +427,7 @@ do\n \tif test $apply_status != 0\n \tthen\n \t\techo Patch failed at $msgnum.\n-\t\tstop_here $this\n+\t\tstop_here_user_resolve $this\n \tfi\n \n \tif test -x \"$GIT_DIR\"/hooks/pre-applypatch\n\n"}]}