summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4974c2c)
raw | patch | inline | side by side (parent: 4974c2c)
author | Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> | |
Sun, 6 Feb 2011 18:43:52 +0000 (13:43 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 10 Feb 2011 22:08:09 +0000 (14:08 -0800) |
Factor out the common parts of the handling of the sub commands
'--continue', '--skip' and '--abort'. The '--abort' handling can
handled completely in git-rebase.sh.
After this refactoring, the calls to git-rebase--am.sh,
git-rebase--merge.sh and git-rebase--interactive.sh will be better
aligned. There will only be one call to interactive rebase that will
shortcut the very last part of git-rebase.sh.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
'--continue', '--skip' and '--abort'. The '--abort' handling can
handled completely in git-rebase.sh.
After this refactoring, the calls to git-rebase--am.sh,
git-rebase--merge.sh and git-rebase--interactive.sh will be better
aligned. There will only be one call to interactive rebase that will
shortcut the very last part of git-rebase.sh.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh | patch | blob | history | |
git-rebase.sh | patch | blob | history |
index affa467a63ca5131d0c60cc3e5a352be5aec57b3..4af0bc6c8f72ebe1f94d1ef3258069ed06ee7c59 100755 (executable)
test -s "$todo" && return
comment_for_reflog finish &&
- head_name=$(cat "$state_dir"/head-name) &&
- orig_head=$(cat "$state_dir"/head) &&
- shortonto=$(git rev-parse --short $(cat "$state_dir"/onto)) &&
+ shortonto=$(git rev-parse --short $onto) &&
newhead=$(git rev-parse HEAD) &&
case $head_name in
refs/*)
;;
esac && {
test ! -f "$state_dir"/verbose ||
- git diff-tree --stat $(cat "$state_dir"/head)..HEAD
+ git diff-tree --stat $orig_head..HEAD
} &&
{
test -s "$rewritten_list" &&
case "$action" in
continue)
get_saved_options
- comment_for_reflog continue
-
- # Sanity check
- git rev-parse --verify HEAD >/dev/null ||
- die "Cannot read HEAD"
- git update-index --ignore-submodules --refresh &&
- git diff-files --quiet --ignore-submodules ||
- die "Working tree is dirty"
# do we have anything to commit?
if git diff-index --cached --quiet --ignore-submodules HEAD --
require_clean_work_tree "rebase"
do_rest
;;
-abort)
- get_saved_options
- comment_for_reflog abort
-
- git rerere clear
-
- head_name=$(cat "$state_dir"/head-name)
- orig_head=$(cat "$state_dir"/head)
- case $head_name in
- refs/*)
- git symbolic-ref HEAD $head_name
- ;;
- esac &&
- output git reset --hard $orig_head &&
- rm -rf "$state_dir"
- exit
- ;;
skip)
get_saved_options
- comment_for_reflog skip
git rerere clear
- output git reset --hard && do_rest
+ do_rest
;;
esac
diff --git a/git-rebase.sh b/git-rebase.sh
index 42d635bc298edd74bcd2100b1115195a74b3f115..21bb0276e11bcc4899dc52edc7ec3a7b9ccd4b22 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
read_basic_state () {
head_name=$(cat "$state_dir"/head-name) &&
onto=$(cat "$state_dir"/onto) &&
- orig_head=$(cat "$state_dir"/orig-head) &&
+ if test "$type" = interactive
+ then
+ orig_head=$(cat "$state_dir"/head)
+ else
+ orig_head=$(cat "$state_dir"/orig-head)
+ fi &&
GIT_QUIET=$(cat "$state_dir"/quiet)
}
if test -n "$action"
then
test -z "$in_progress" && die "No rebase in progress?"
- test "$type" = interactive && run_specific_rebase
+ # Only interactive rebase uses detailed reflog messages
+ if test "$type" = interactive && test "$GIT_REFLOG_ACTION" = rebase
+ then
+ GIT_REFLOG_ACTION="rebase -i ($action)"
+ export GIT_REFLOG_ACTION
+ fi
fi
case "$action" in
continue)
+ # Sanity check
+ git rev-parse --verify HEAD >/dev/null ||
+ die "Cannot read HEAD"
git update-index --ignore-submodules --refresh &&
git diff-files --quiet --ignore-submodules || {
echo "You must edit all merge conflicts and then"