Skip to content

Commit

Permalink
Use nice names in conflict markers during cherry-pick/revert.
Browse files Browse the repository at this point in the history
Always call the current HEAD 'HEAD', and name the patch being
cherry-picked or reverted by its oneline subject rather than
its SHA1.  This matches git am's behavior and is done because
users most commonly are cherry-picking by SHA1 rather than by
ref name.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Jan 15, 2007
1 parent acb4441 commit 6e2931a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions git-revert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ cherry-pick)

esac >.msg

eval GITHEAD_$head=HEAD
eval GITHEAD_$next='`git show -s \
--pretty=oneline --encoding="$encoding" "$commit" |
sed -e "s/^[^ ]* //"`'
export GITHEAD_$head GITHEAD_$next

# This three way merge is an interesting one. We are at
# $head, and would want to apply the change between $commit
# and $prev on top of us (when reverting), or the change between
Expand Down

0 comments on commit 6e2931a

Please sign in to comment.