git-merge: Put FETCH_HEAD data in merge commit message
authorMichael S. Tsirkin <mst@dev.mellanox.co.il>
Thu, 22 Mar 2007 09:07:30 +0000 (11:07 +0200)
committerJunio C Hamano <junkio@cox.net>
Thu, 22 Mar 2007 10:01:43 +0000 (03:01 -0700)
This makes git-fetch <URL> && git-merge FETCH_HEAD produce the
same merge message as git-pull <URL>.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-merge.sh

index 8759c5a7e0f8748108d6eff005cde1e0893f3592..fa4589173f426d6172883c47479c52b8700cafa8 100755 (executable)
@@ -108,6 +108,10 @@ merge_name () {
                git-show-ref -q --verify "refs/heads/$truname" 2>/dev/null
        then
                echo "$rh               branch '$truname' (early part) of ."
+       elif test "$remote" = "FETCH_HEAD" -a -r "$GIT_DIR/FETCH_HEAD"
+       then
+               sed -e 's/      not-for-merge   /               /' -e 1q \
+                       "$GIT_DIR/FETCH_HEAD"
        else
                echo "$rh               commit '$remote'"
        fi