X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-octopus.sh;h=d2471af3c8a002c175bf9b1370039b9e7d4ab946;hb=1bd8c8f00b1c7facb67c99047fe777b53f2c49ff;hp=521cc6f3611bcaf5454ad83baf0bec2e0b66483d;hpb=215a7ad1ef790467a4cd3f0dcffbd6e5f04c38f7;p=git.git diff --git a/git-octopus.sh b/git-octopus.sh index 521cc6f3..d2471af3 100755 --- a/git-octopus.sh +++ b/git-octopus.sh @@ -27,7 +27,7 @@ test "$(git-diff-index --cached "$head")" = "" || # MRC is the current "merge reference commit" # MRT is the current "merge result tree" -MRC=$head MSG= PARENT="-p $head" +MRC=$head PARENT="-p $head" MRT=$(git-write-tree) CNT=1 ;# counting our head NON_FF_MERGE=0 @@ -44,8 +44,6 @@ do CNT=`expr $CNT + 1` PARENT="$PARENT -p $SHA1" - MSG="$MSG - $REPO" if test "$common,$NON_FF_MERGE" = "$MRC,0" then @@ -84,20 +82,9 @@ case "$CNT" in 1) echo "No changes." exit 0 ;; -2) - echo "Not an Octopus; making an ordinary commit." - MSG="Merge "`expr "$MSG" : '. \(.*\)'` ; # remove LF and TAB - ;; -*) - # In an octopus, the original head is just one of the equals, - # so we should list it as such. - HEAD_LINK=`readlink "$GIT_DIR/HEAD"` - MSG="Octopus merge of the following: - - $HEAD_LINK from .$MSG" - ;; esac -result_commit=$(echo "$MSG" | git-commit-tree $MRT $PARENT) +result_commit=$(git-fmt-merge-msg <"$GIT_DIR/FETCH_HEAD" | + git-commit-tree $MRT $PARENT) echo "Committed merge $result_commit" -echo $result_commit >"$GIT_DIR"/HEAD +git-update-ref HEAD $result_commit $head git-diff-tree -p $head $result_commit | git-apply --stat