From 05bdcfe5fc3d626b752c2cb574f05ed30b279bcf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kr=C3=BCger?= Date: Sun, 30 May 2010 10:19:26 +0200 Subject: [PATCH] git-am: suggest what to do with superfluous patches MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Particularly in the context of rebase, conflicts frequently occur because the change in the patch to be applied was made obsolete by new upstream commits. In this case, solving the conflict effectively means skipping the patch. However, it's not always readily apparent that the patch needs to be skipped, and when people solve the conflict and try git rebase --continue, they get confronted with a message of No changes - did you forget to use 'git add'? That's not very helpful if you did actually stage your changes and they happen to turn the patch into a no-op. This extends the message to point out what's going on. Signed-off-by: Jan Krüger Signed-off-by: Junio C Hamano --- git-am.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-am.sh b/git-am.sh index 87ffae252..43ea52c15 100755 --- a/git-am.sh +++ b/git-am.sh @@ -726,6 +726,8 @@ do resolved= git diff-index --quiet --cached HEAD -- && { echo "No changes - did you forget to use 'git add'?" + echo "If there is nothing left to stage, chances are that something else" + echo "already introduced the same changes; you might want to skip this patch." stop_here_user_resolve $this } unmerged=$(git ls-files -u) -- 2.30.2