diff --git a/Reintegrate b/Reintegrate index d9f14f2363..21da827f46 100755 --- a/Reintegrate +++ b/Reintegrate @@ -25,6 +25,7 @@ no) return 1 else EDITOR=: git commit -a --no-verify + echo "Accepted previous resolution" return 0 fi } @@ -50,16 +51,28 @@ no) exit esac -merge_msg="Merge branch '\(.*\)'" x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' x40="$x40$x40$x40$x40$x40$x40$x40$x40" LF=' ' show_merge () { - branch=$(expr "$msg" : "$merge_msg") && - tip=$(git rev-parse --verify "refs/heads/$branch" 2>/dev/null) && - merged=$(git name-rev --refs="refs/heads/$branch" "$other" 2>/dev/null) && + case "$msg" in + "Merge branch '"*"'"*" into "*) + branch=$(expr "$msg" : "Merge branch '\(.*\)'") + merge_hier=heads/ + ;; + "Merge remote branch '"*"'"*" into "*) + branch=$(expr "$msg" : "Merge remote branch '\(.*\)'") + merge_hier= + ;; + *) + echo 2>&1 "Huh?: $msg" + exit 1 + ;; + esac && + tip=$(git rev-parse --verify "refs/$merge_hier$branch" 2>/dev/null) && + merged=$(git name-rev --refs="refs/$merge_hier$branch" "$other" 2>/dev/null) && merged=$(expr "$merged" : "$x40 \(.*\)") && test "$merged" != undefined || { other=$(git log -1 --pretty='format:%s' $other) &&