X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-merge.sh;h=a05eeb29f6af4a60fab0d0b918cf319dbcbd3144;hb=39c015c556f285106931e0500f301de462b0e46e;hp=e50fbb1160ad6ccfebc0d65fcc54bc3488e597cd;hpb=1ed91937e5cd59fdbdfa5f15f6fac132d2b21ce0;p=git.git diff --git a/git-merge.sh b/git-merge.sh index e50fbb11..a05eeb29 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -13,6 +13,10 @@ LF=' all_strategies='recursive octopus resolve stupid ours' default_strategies='recursive' use_strategies= +if test "@@NO_PYTHON@@"; then + all_strategies='resolve octopus stupid ours' + default_strategies='resolve' +fi dropsave() { rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \ @@ -209,6 +213,7 @@ case "$use_strategies" in esac result_tree= best_cnt=-1 best_strategy= wt_strategy= +merge_was_ok= for strategy in $use_strategies do test "$wt_strategy" = '' || { @@ -228,6 +233,7 @@ do exit=$? if test "$no_commit" = t && test "$exit" = 0 then + merge_was_ok=t exit=1 ;# pretend it left conflicts. fi @@ -291,6 +297,25 @@ for remote do echo $remote done >"$GIT_DIR/MERGE_HEAD" -echo $merge_msg >"$GIT_DIR/MERGE_MSG" +echo "$merge_msg" >"$GIT_DIR/MERGE_MSG" -die "Automatic merge failed/prevented; fix up by hand" +if test "$merge_was_ok" = t +then + echo >&2 \ + "Automatic merge went well; stopped before committing as requested" + exit 0 +else + { + echo ' +Conflicts: +' + git ls-files --unmerged | + sed -e 's/^[^ ]* / /' | + uniq + } >>"$GIT_DIR/MERGE_MSG" + if test -d "$GIT_DIR/rr-cache" + then + git-rerere + fi + die "Automatic merge failed; fix up by hand" +fi