diff options
author | Ramkumar Ramachandra <artagnon@gmail.com> | 2013-06-16 14:15:13 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-23 22:16:42 -0700 |
commit | 26cd160cb15635afd1c2937a3c15cfb256758323 (patch) | |
tree | 5307ca3e6aab73d1f391fbe28988b8151acb3cb7 /t | |
parent | 4b03df210f77ac84ebed324c5d031f32872aaf0b (diff) | |
download | git-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 't')
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index a58406d12..971e21414 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -934,6 +934,21 @@ test_expect_success 'rebase --edit-todo can be used to modify todo' ' test L = $(git cat-file commit HEAD | sed -ne \$p) ' +test_expect_success 'rebase -i produces readable reflog' ' + git reset --hard && + git branch -f branch-reflog-test H && + git rebase -i --onto I F branch-reflog-test && + cat >expect <<-\EOF && + rebase -i (start): checkout I + rebase -i (pick): G + rebase -i (pick): H + rebase -i (finish): returning to refs/heads/branch-reflog-test + EOF + tail -n 4 .git/logs/HEAD | + sed -e "s/.* //" >actual && + test_cmp expect actual +' + test_expect_success 'rebase -i respects core.commentchar' ' git reset --hard && git checkout E^0 && |