aboutsummaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-06-16 14:15:13 +0530
committerJunio C Hamano <gitster@pobox.com>2013-06-23 22:16:42 -0700
commit26cd160cb15635afd1c2937a3c15cfb256758323 (patch)
tree5307ca3e6aab73d1f391fbe28988b8151acb3cb7 /git-rebase--interactive.sh
parent4b03df210f77ac84ebed324c5d031f32872aaf0b (diff)
downloadgit-26cd160cb15635afd1c2937a3c15cfb256758323.tar.gz
git-26cd160cb15635afd1c2937a3c15cfb256758323.tar.xz
rebase -i: use a better reflog message
Now that the "checkout" invoked internally from "rebase -i" 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 -i: checkout master instead of the old rebase -i As all the calls git-rebase--interactive make to underlying git commands that leave reflog messages are preceded by the internal comment_for_reflog helper function, which uses the original value of the GIT_REFLOG_ACTION variable it saw when it first started, the new assignments to GIT_REFLOG_ACTION actively contaminate the value of the variable, knowing that it will be reset to a sane value before it is used again. This does not generally hold true but it should suffice for now. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 5822b2c59..a97552935 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -837,8 +837,11 @@ comment_for_reflog start
if test ! -z "$switch_to"
then
+ GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $switch_to"
output git checkout "$switch_to" -- ||
- die "Could not checkout $switch_to"
+ die "Could not checkout $switch_to"
+
+ comment_for_reflog start
fi
orig_head=$(git rev-parse --verify HEAD) || die "No HEAD?"
@@ -980,6 +983,7 @@ has_action "$todo" ||
test -d "$rewritten" || test -n "$force_rebase" || skip_unnecessary_picks
+GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $onto_name"
output git checkout $onto || die_abort "could not detach HEAD"
git update-ref ORIG_HEAD $orig_head
do_rest