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 <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Aug 10, 2012 at 08:51 UTC
1af221ef5cb84c792303a0d16ca91197e2b70279
1 file changed
+1
-2
git-rebase--interactive.sh
+1
-2
@@ -533,11 +533,10 @@ do_next () {
533
test -s "$todo" && return
534
535
comment_for_reflog finish &&
536
- shortonto=$(git rev-parse --short $onto) &&
536
newhead=$(git rev-parse HEAD) &&
537
case $head_name in
538
refs/*)
540
- message="$GIT_REFLOG_ACTION: $head_name onto $shortonto" &&
539
+ message="$GIT_REFLOG_ACTION: $head_name onto $onto" &&
540
git update-ref -m "$message" $head_name $newhead $orig_head &&
541
git symbolic-ref \
542
-m "$GIT_REFLOG_ACTION: returning to $head_name" \