Merge branch 'pg/maint-1.7.9-am-where-is-patch' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 30 Jul 2012 20:04:39 +0000 (13:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Jul 2012 20:04:39 +0000 (13:04 -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 915cb5a547896966377e9f39059527e3142b27c8..b49feb582ef6c780a9dd1831bcd7e013e774b7c6 100644 (file)
@@ -176,6 +176,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 f8b7a0cb602d2d2425f68f8c27338cc003b70f6b..9abad36abdea89c88d7d0378fd2d556057bc065b 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -855,6 +855,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