Skip to content

Commit 1af221e

Browse files
Michael J Grubergitster
authored andcommitted
rebase -i: use full onto sha1 in reflog
'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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 785ee49 commit 1af221e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

git-rebase--interactive.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,10 @@ do_next () {
533533
test -s "$todo" && return
534534

535535
comment_for_reflog finish &&
536-
shortonto=$(git rev-parse --short $onto) &&
537536
newhead=$(git rev-parse HEAD) &&
538537
case $head_name in
539538
refs/*)
540-
message="$GIT_REFLOG_ACTION: $head_name onto $shortonto" &&
539+
message="$GIT_REFLOG_ACTION: $head_name onto $onto" &&
541540
git update-ref -m "$message" $head_name $newhead $orig_head &&
542541
git symbolic-ref \
543542
-m "$GIT_REFLOG_ACTION: returning to $head_name" \

0 commit comments

Comments
 (0)