summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c54b781)
raw | patch | inline | side by side (parent: c54b781)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Mon, 25 Jun 2007 17:58:28 +0000 (18:58 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Jun 2007 01:58:59 +0000 (18:58 -0700) |
If your rebase succeeded, the HEAD's reflog will still show the whole
mess, but "<branchname>@{1}" now shows the state _before_ the rebase,
so that you can reset (or compare) the original and the rebased
revisions more easily.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mess, but "<branchname>@{1}" now shows the state _before_ the rebase,
so that you can reset (or compare) the original and the rebased
revisions more easily.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh | patch | blob | history | |
t/t3404-rebase-interactive.sh | patch | blob | history |
index a81432c0a5b9e5caca47d58665b47c75accacc74..f0f2457975edcedaf9cf241efa189ae2fb081de7 100755 (executable)
esac
test -s "$TODO" && return
- HEAD=$(git rev-parse HEAD)
- HEADNAME=$(cat "$DOTEST"/head-name)
+ comment_for_reflog finish &&
+ HEADNAME=$(cat "$DOTEST"/head-name) &&
+ OLDHEAD=$(cat "$DOTEST"/head) &&
+ SHORTONTO=$(git rev-parse --short $(cat "$DOTEST"/onto)) &&
+ NEWHEAD=$(git rev-parse HEAD) &&
+ message="$GIT_REFLOG_ACTION: $HEADNAME onto $SHORTONTO)" &&
+ git update-ref -m "$message" $HEADNAME $NEWHEAD $OLDHEAD &&
+ git symbolic-ref HEAD $HEADNAME &&
rm -rf "$DOTEST" &&
warn "Successfully rebased and updated $HEADNAME."
index 19a3a8e813785fbb1a6cfc522bff212ec3a9e6fc..9f12bb932115629669625fad131c6aa580e572f1 100755 (executable)
test $(git rev-parse I) = $(git rev-parse HEAD~2)
'
+test_expect_success 'reflog for the branch shows state before rebase' '
+ test $(git rev-parse branch1@{1}) = $(git rev-parse original-branch1)
+'
+
test_expect_success 'exchange two commits' '
FAKE_LINES="2 1" git rebase -i HEAD~2 &&
test H = $(git cat-file commit HEAD^ | tail -n 1) &&