From e0ec18192db8a5f80705a81dfaa1caa3e6c48c1a Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 23 Dec 2006 03:44:47 -0500 Subject: Display 'theirs' branch name when possible in merge. Displaying the SHA1 of 'their' branch (the branch being merged into the current branch) is not nearly as friendly as just displaying the name of that branch, especially if that branch is already local to this repository. git-merge now sets the environment variable 'GITHEAD_%(sha1)=%(name)' for each argument it gets passed, making the actual input name that resolved to the commit '%(sha1)' easily available to the invoked merge strategy. git-merge-recursive makes use of these environment variables when they are available by using '%(name)' whenever it outputs the commit identification rather than '%(sha1)'. This is most obvious in the conflict hunks created by xdl_merge: $ git mege sideb~1 <<<<<<< HEAD:INSTALL Good! ======= Oops. >>>>>>> sideb~1:INSTALL [jc: adjusted a test script and a minor constness glitch.] Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- git-merge.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git-merge.sh') diff --git a/git-merge.sh b/git-merge.sh index aec215e725..7dd0a11236 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -221,6 +221,8 @@ do remotehead=$(git-rev-parse --verify "$remote"^0 2>/dev/null) || die "$remote - not something we can merge" remoteheads="${remoteheads}$remotehead " + eval GITHEAD_$remotehead='"$remote"' + export GITHEAD_$remotehead done set x $remoteheads ; shift -- cgit v1.2.3