Skip to content

Commit c884dd9

Browse files
author
Junio C Hamano
committed
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>
1 parent 4dc0002 commit c884dd9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

git-merge-octopus.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,8 @@ do
5353
common=$(git-merge-base --all $MRC $SHA1) ||
5454
die "Unable to find common commit with $SHA1"
5555

56-
case "$common" in
57-
?*"$LF"?*)
58-
die "Not trivially mergeable."
59-
;;
60-
$SHA1)
56+
case "$LF$common$LF" in
57+
*"$LF$SHA1$LF"*)
6158
echo "Already up-to-date with $SHA1"
6259
continue
6360
;;
@@ -87,8 +84,11 @@ do
8784
if test $? -ne 0
8885
then
8986
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+
}
9292
next=$(git-write-tree 2>/dev/null)
9393
fi
9494

0 commit comments

Comments
 (0)