diff --git a/Documentation/config.txt b/Documentation/config.txt index 0e1168c066..b1f0a75c6f 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -143,6 +143,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:: diff --git a/git-am.sh b/git-am.sh index cb833e217a..f1ae932fa7 100755 --- a/git-am.sh +++ b/git-am.sh @@ -834,6 +834,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