[PATCHv2] put FETCH_HEAD data in merge commit message
- From
- Michael S. Tsirkin <mst@dev.mellanox.co.il>
- Date
- Mar 21, 2007, 17:29 UTC
- Message-ID
- <20070321172916.GC5233@mellanox.co.il>
- In-Reply-To
- <20070321120643.GI20583@mellanox.co.il>
Show 20 quoted lines
> Quoting Michael S. Tsirkin <mst@dev.mellanox.co.il>: > Subject: [PATCH] have merge put FETCH_HEAD data in commit message > > Hi! > I often like to fetch some code from others, review and > then merge. So: > > git fetch <URL> > git log -p FETCH_HEAD > git merge FETCH_HEAD > > which is all good but gets me this message in commit log: > > Merge commit 'FETCH_HEAD' into master > > which is not very informative. > I can always fix this up with git commit --amend, but > I'd like to avoid the extra step. > > Would the following patch be appropriate?
OK, I since discovered git-fmt-merge-msg does all the necessary formatting, so here's a better and smaller patch. Seems to work well for me.
Junio, could you apply this?
-------------------------
Make git-fetch <URL> && git-merge FETCH_HEAD produce same merge message as git-pull <URL>
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
---
diff --git a/git-merge.sh b/git-merge.sh index 8759c5a..1e11593 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -108,6 +108,9 @@ merge_name () { git-show-ref -q --verify "refs/heads/$truname" 2>/dev/null then echo "$rh branch '$truname' (early part) of ." + elif test -r "$GIT_DIR/$remote" + then + cat "$GIT_DIR/$remote" else echo "$rh commit '$remote'" fi
-- MST