From b656c14ce48119d303be3d368b6af0ad59a3a0c1 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 12 Jun 2013 16:17:45 -0500 Subject: [PATCH] merging-rebase: be more suspicious about merging-rebase candidates Sometimes people commit all kinds of stuff before performing a merging rebase, and that unfortunately also entails merges that look like '-s ours' type merges. Therefore, it is not good enough to look whether the merge looks like that, but we also have to ask the user if that's the start of the latest merging rebase. Only when we find that the commit subject contains 'merging-rebase', we trust that we have found the correct merge. Signed-off-by: Johannes Schindelin --- share/msysGit/merging-rebase.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/share/msysGit/merging-rebase.sh b/share/msysGit/merging-rebase.sh index a0071b5e..f17ac5d9 100755 --- a/share/msysGit/merging-rebase.sh +++ b/share/msysGit/merging-rebase.sh @@ -103,6 +103,19 @@ for commit in $(list_merges $TO..) do if is_ours_merge $commit then + subject="$(git show -s --format=%s $commit)" + case "$subject" in + *merging-rebase*) ;; + *) + printf "%s\n\n%s\n%s\n\n(y/n) " \ + "Is this the latest merging rebase?" \ + $commit "$subject" + read answer + case "$answer" in + y*|Y*) ;; + *) continue;; + esac;; + esac REBASING_BASE=$commit break fi -- 2.11.4.GIT