diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-06-25 18:58:28 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-26 18:58:59 -0700 |
commit | 68a163c9b483ae352fcfee8c4505d113213daa73 (patch) | |
tree | a2f269413367d19626c13915811a6ff4babf97fd /git-rebase--interactive.sh | |
parent | c54b7817f4f6bf422ea532d81217c28f63c259c5 (diff) | |
download | git-68a163c9b483ae352fcfee8c4505d113213daa73.tar.gz |
rebase -i: provide reasonable reflog for the rebased branch
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>
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-x | git-rebase--interactive.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index a81432c0a5..f0f2457975 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -151,8 +151,14 @@ do_next () { 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." |