rebase: use a better reflog message
Now that the "checkout" invoked internally from "rebase" knows to honor GIT_REFLOG_ACTION, we can start to use it to write a better reflog message when "rebase anotherbranch", "rebase --onto branch", etc. internally checks out the new fork point. We will write: rebase: checkout master instead of the old rebase Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramkumar Ramachandra committed
Jun 16, 2013 at 14:15 UTC
4b03df210f77ac84ebed324c5d031f32872aaf0b
1 file changed
+6
-2
git-rebase.sh
+6
-2
@@ -497,7 +497,9 @@ then
497
if test -z "$force_rebase"
498
then
499
# Lazily switch to the target branch if needed...
500
- test -z "$switch_to" || git checkout "$switch_to" --
500
+ test -z "$switch_to" ||
501
+ GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $switch_to" \
502
+ git checkout "$switch_to" --
503
say "$(eval_gettext "Current branch \$branch_name is up to date.")"
504
exit 0
505
else
@@ -522,7 +524,9 @@ test "$type" = interactive && run_specific_rebase
524
525
# Detach HEAD and reset the tree
526
say "$(gettext "First, rewinding head to replay your work on top of it...")"
525
-git checkout -q "$onto^0" || die "could not detach HEAD"
527
+
528
+GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $onto_name" \
529
+ git checkout -q "$onto^0" || die "could not detach HEAD"
530
git update-ref ORIG_HEAD $orig_head
531
532
# If the $onto is a proper descendant of the tip of the branch, then