aboutsummaryrefslogtreecommitdiff
path: root/git-revert.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-01-15 01:41:22 -0500
committerJunio C Hamano <junkio@cox.net>2007-01-14 23:17:32 -0800
commit6e2931a8ed887bd75ed68085a7e04bc88574d69e (patch)
treea88c0de8e369cbf70b17fbe123305441d70f4c8f /git-revert.sh
parentacb4441e0dabaaa666ecae11fdafc27c3691e763 (diff)
downloadgit-6e2931a8ed887bd75ed68085a7e04bc88574d69e.tar.gz
git-6e2931a8ed887bd75ed68085a7e04bc88574d69e.tar.xz
Use nice names in conflict markers during cherry-pick/revert.
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>
Diffstat (limited to 'git-revert.sh')
-rwxr-xr-xgit-revert.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-revert.sh b/git-revert.sh
index c74af99a5..bb8f1ca24 100755
--- a/git-revert.sh
+++ b/git-revert.sh
@@ -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