Code

Update draft release notes for 1.5.1
[git.git] / git-revert.sh
index c74af99a5165a4e2671761fd0977211fc7b4f663..49f00321b28833c24ebb78ea2104f34091d43017 100755 (executable)
@@ -54,6 +54,8 @@ do
        shift
 done
 
+set_reflog_action "$me"
+
 test "$me,$replay" = "revert,t" && usage
 
 case "$no_commit" in
@@ -81,7 +83,7 @@ prev=$(git-rev-parse --verify "$commit^1" 2>/dev/null) ||
 git-rev-parse --verify "$commit^2" >/dev/null 2>&1 &&
        die "Cannot run $me a multi-parent commit."
 
-encoding=$(git repo-config i18n.commitencoding || echo UTF-8)
+encoding=$(git config i18n.commitencoding || echo UTF-8)
 
 # "commit" is an existing commit.  We would want to apply
 # the difference it introduces since its first parent "prev"
@@ -146,6 +148,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