merging-rebase: be more suspicious about merging-rebase candidates
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 12 Jun 2013 21:17:45 +0000 (12 16:17 -0500)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 12 Jun 2013 21:17:45 +0000 (12 16:17 -0500)
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 <johannes.schindelin@gmx.de>
share/msysGit/merging-rebase.sh

index a0071b5..f17ac5d 100755 (executable)
@@ -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