Skip to content

Commit

Permalink
rebase -i: use full onto sha1 in reflog
Browse files Browse the repository at this point in the history
'git rebase' uses the full onto sha1 for the reflog message whereas 'git
rebase -i' uses the short sha1. This is not only inconsistent, but can
lead to problems when the reflog is inspected at a later time at which
that abbreviation may have become ambiguous.

Make 'rebase -i' use the full onto sha1, as well.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Aug 10, 2012
1 parent 785ee49 commit 1af221e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,10 @@ do_next () {
test -s "$todo" && return

comment_for_reflog finish &&
shortonto=$(git rev-parse --short $onto) &&
newhead=$(git rev-parse HEAD) &&
case $head_name in
refs/*)
message="$GIT_REFLOG_ACTION: $head_name onto $shortonto" &&
message="$GIT_REFLOG_ACTION: $head_name onto $onto" &&
git update-ref -m "$message" $head_name $newhead $orig_head &&
git symbolic-ref \
-m "$GIT_REFLOG_ACTION: returning to $head_name" \
Expand Down

0 comments on commit 1af221e

Please sign in to comment.