summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-06-16 14:15:12 +0530
committerJunio C Hamano <gitster@pobox.com>2013-06-23 22:04:43 -0700
commit4b03df210f77ac84ebed324c5d031f32872aaf0b (patch)
tree874ba3df5a7bf771427ee5ec9018d271d0608976 /git-rebase.sh
parent3bed291a3b121408b4de83f4fa3cc0f1d98c676e (diff)
downloadgit-4b03df210f77ac84ebed324c5d031f32872aaf0b.tar.gz
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>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 2c692c33e9..79f526eb9a 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -497,7 +497,9 @@ then
if test -z "$force_rebase"
then
# Lazily switch to the target branch if needed...
- test -z "$switch_to" || git checkout "$switch_to" --
+ test -z "$switch_to" ||
+ GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $switch_to" \
+ git checkout "$switch_to" --
say "$(eval_gettext "Current branch \$branch_name is up to date.")"
exit 0
else
@@ -522,7 +524,9 @@ test "$type" = interactive && run_specific_rebase
# Detach HEAD and reset the tree
say "$(gettext "First, rewinding head to replay your work on top of it...")"
-git checkout -q "$onto^0" || die "could not detach HEAD"
+
+GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $onto_name" \
+ git checkout -q "$onto^0" || die "could not detach HEAD"
git update-ref ORIG_HEAD $orig_head
# If the $onto is a proper descendant of the tip of the branch, then