Skip to content

Commit 4b03df2

Browse files
artagnongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3bed291 commit 4b03df2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

git-rebase.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,9 @@ then
497497
if test -z "$force_rebase"
498498
then
499499
# 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" --
501503
say "$(eval_gettext "Current branch \$branch_name is up to date.")"
502504
exit 0
503505
else
@@ -522,7 +524,9 @@ test "$type" = interactive && run_specific_rebase
522524

523525
# Detach HEAD and reset the tree
524526
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"
526530
git update-ref ORIG_HEAD $orig_head
527531

528532
# If the $onto is a proper descendant of the tip of the branch, then

0 commit comments

Comments
 (0)