@matheusbsbs / matheus-bagliano / commits / c884dd9a54
Fork 0

octopus: allow criss-cross and clarify the message when it rejects

We rejected multi-base merge situations even though we used the same underlying multi-base git-read-tree as the resolve strategy uses. This was unneeded and did not add much to ensure the merge to be truly trivial, so remove this restriction and be more similar to what resolve does. Also when the merge did not trivially resolve, we rejected without stating that octopus strategy does not handle the situation. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jan 13, 2006 at 01:37 UTC c884dd9a54fcde71ea125c86e6b6ab92acbbc7cf
1 file changed +7 -7
git-merge-octopus.sh
+7 -7
@@ -53,11 +53,8 @@ do
53 common=$(git-merge-base --all $MRC $SHA1) ||
54 die "Unable to find common commit with $SHA1"
55
56 - case "$common" in
57 - ?*"$LF"?*)
58 - die "Not trivially mergeable."
59 - ;;
60 - $SHA1)
56 + case "$LF$common$LF" in
57 + *"$LF$SHA1$LF"*)
58 echo "Already up-to-date with $SHA1"
59 continue
60 ;;
@@ -87,8 +84,11 @@ do
84 if test $? -ne 0
85 then
86 echo "Simple merge did not work, trying automatic merge."
90 - git-merge-index -o git-merge-one-file -a ||
91 - exit 2 ; # Automatic merge failed; should not be doing Octopus
87 + git-merge-index -o git-merge-one-file -a || {
88 + echo "Not trivially merged."
89 + echo "Should not be doing an Octopus."
90 + exit 2
91 + }
92 next=$(git-write-tree 2>/dev/null)
93 fi
94