Merge branch 'pg/maint-1.7.9-am-where-is-patch'
authorJunio C Hamano <gitster@pobox.com>
Sun, 22 Jul 2012 19:56:02 +0000 (12:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 22 Jul 2012 19:56:02 +0000 (12:56 -0700)
When "git am" failed, old timers knew to check .git/rebase-apply/patch
to see what went wrong, but we never told the users about it.

* pg/maint-1.7.9-am-where-is-patch:
am: indicate where a failed patch is to be found

Documentation/config.txt
git-am.sh
index 7bc0e5384871dc4c10df038cacee7c9d9370c4da..a95e5a4ac9a7e35623ada63d7919b193d7f86a6e 100644 (file)
@@ -177,6 +177,9 @@ advice.*::
                Advice shown when you used linkgit:git-checkout[1] to
                move to the detach HEAD state, to instruct how to create
                a local branch after the fact.
+       amWorkDir::
+               Advice that shows the location of the patch file when
+               linkgit:git-am[1] fails to apply it.
 --
 
 core.fileMode::
index b6a530018e18527efc8ed788e815b380d0206787..c02e62d2aa4f3bd2221c687effa3a4ec44918383 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -857,6 +857,11 @@ did you forget to use 'git add'?"
        if test $apply_status != 0
        then
                eval_gettextln 'Patch failed at $msgnum $FIRSTLINE'
+               if test "$(git config --bool advice.amworkdir)" != false
+               then
+                       eval_gettextln "The copy of the patch that failed is found in:
+   $dotest/patch"
+               fi
                stop_here_user_resolve $this
        fi