/git-rebase--am
/git-rebase--common
/git-rebase--interactive
-/git-rebase--merge
/git-rebase--preserve-merges
/git-receive-pack
/git-reflog
INCOMPATIBLE OPTIONS
--------------------
-git-rebase has many flags that are incompatible with each other,
-predominantly due to the fact that it has three different underlying
-implementations:
-
- * one based on linkgit:git-am[1] (the default)
- * one based on git-merge-recursive (merge backend)
- * one based on linkgit:git-cherry-pick[1] (interactive backend)
-
-Flags only understood by the am backend:
+The following options:
* --committer-date-is-author-date
* --ignore-date
* --ignore-whitespace
* -C
-Flags understood by both merge and interactive backends:
+are incompatible with the following options:
* --merge
* --strategy
* --strategy-option
* --allow-empty-message
-
-Flags only understood by the interactive backend:
-
* --[no-]autosquash
* --rebase-merges
* --preserve-merges
* --edit-todo
* --root when used in combination with --onto
-Other incompatible flag pairs:
+In addition, the following pairs of options are incompatible:
* --preserve-merges and --interactive
* --preserve-merges and --signoff
SCRIPT_LIB += git-rebase--am
SCRIPT_LIB += git-rebase--common
SCRIPT_LIB += git-rebase--preserve-merges
-SCRIPT_LIB += git-rebase--merge
SCRIPT_LIB += git-sh-setup
SCRIPT_LIB += git-sh-i18n
if (clean_index(&head, &head))
die(_("failed to clean index"));
+ if (state->rebasing) {
+ FILE *fp = xfopen(am_path(state, "rewritten"), "a");
+
+ assert(!is_null_oid(&state->orig_commit));
+ fprintf(fp, "%s ", oid_to_hex(&state->orig_commit));
+ fprintf(fp, "%s\n", oid_to_hex(&head));
+ fclose(fp);
+ }
+
am_next(state);
am_load(state);
am_run(state, 0);
case REBASE_PRESERVE_MERGES:
break;
case REBASE_MERGE:
- /* we silently *upgrade* --merge to --interactive if needed */
+ /* we now implement --merge via --interactive */
default:
opts->type = REBASE_INTERACTIVE; /* implied */
break;
if (get_oid(buf.buf, &opts->orig_head))
return error(_("invalid orig-head: '%s'"), buf.buf);
- strbuf_reset(&buf);
- if (read_one(state_dir_path("quiet", opts), &buf))
- return -1;
- if (buf.len)
+ if (file_exists(state_dir_path("quiet", opts)))
opts->flags &= ~REBASE_NO_QUIET;
else
opts->flags |= REBASE_NO_QUIET;
backend = "git-rebase--am";
backend_func = "git_rebase__am";
break;
- case REBASE_MERGE:
- backend = "git-rebase--merge";
- backend_func = "git_rebase__merge";
- break;
case REBASE_PRESERVE_MERGES:
backend = "git-rebase--preserve-merges";
backend_func = "git_rebase__preserve_merges";
}
}
+ if (options.type == REBASE_MERGE)
+ imply_interactive(&options, "--merge");
+
if (options.root && !options.onto_name)
imply_interactive(&options, "--root without --onto");
break;
if (is_interactive(&options) && i >= 0)
- die(_("error: cannot combine interactive options "
- "(--interactive, --exec, --rebase-merges, "
- "--preserve-merges, --keep-empty, --root + "
- "--onto) with am options (%s)"), buf.buf);
- if (options.type == REBASE_MERGE && i >= 0)
- die(_("error: cannot combine merge options (--merge, "
- "--strategy, --strategy-option) with am options "
- "(%s)"), buf.buf);
+ die(_("cannot combine am options with either "
+ "interactive or merge options"));
}
if (options.signoff) {
* git-rebase.txt caveats with "unless you know what you are doing"
*/
if (options.rebase_merges)
- die(_("error: cannot combine '--preserve-merges' with "
+ die(_("cannot combine '--preserve-merges' with "
"'--rebase-merges'"));
if (options.reschedule_failed_exec)
if (options.rebase_merges) {
if (strategy_options.nr)
- die(_("error: cannot combine '--rebase-merges' with "
+ die(_("cannot combine '--rebase-merges' with "
"'--strategy-option'"));
if (options.strategy)
- die(_("error: cannot combine '--rebase-merges' with "
+ die(_("cannot combine '--rebase-merges' with "
"'--strategy'"));
}
else
orig_head=$(cat "$state_dir"/head)
fi &&
- GIT_QUIET=$(cat "$state_dir"/quiet) &&
+ test -f "$state_dir"/quiet && GIT_QUIET=t
test -f "$state_dir"/verbose && verbose=t
test -f "$state_dir"/strategy && strategy="$(cat "$state_dir"/strategy)"
test -f "$state_dir"/strategy_opts &&
state_dir="$apply_dir"
elif test -d "$merge_dir"
then
+ type=interactive
if test -d "$merge_dir"/rewritten
then
type=preserve-merges
preserve_merges=t
elif test -f "$merge_dir"/interactive
then
- type=interactive
interactive_rebase=explicit
- else
- type=merge
fi
state_dir="$merge_dir"
fi
test -z "$interactive_rebase" && interactive_rebase=implied
fi
+actually_interactive=
if test -n "$interactive_rebase"
then
if test -z "$preserve_merges"
else
type=preserve-merges
fi
-
+ actually_interactive=t
state_dir="$merge_dir"
elif test -n "$do_merge"
then
- type=merge
+ interactive_rebase=implied
+ type=interactive
state_dir="$merge_dir"
else
type=am
git_format_patch_opt="$git_format_patch_opt --progress"
fi
-if test -n "$git_am_opt"; then
- incompatible_opts=$(echo " $git_am_opt " | \
- sed -e 's/ -q / /g' -e 's/^ \(.*\) $/\1/')
- if test -n "$interactive_rebase"
+incompatible_opts=$(echo " $git_am_opt " | \
+ sed -e 's/ -q / /g' -e 's/^ \(.*\) $/\1/')
+if test -n "$incompatible_opts"
+then
+ if test -n "$actually_interactive" || test "$do_merge"
then
- if test -n "$incompatible_opts"
- then
- die "$(gettext "error: cannot combine interactive options (--interactive, --exec, --rebase-merges, --preserve-merges, --keep-empty, --root + --onto) with am options ($incompatible_opts)")"
- fi
- fi
- if test -n "$do_merge"; then
- if test -n "$incompatible_opts"
- then
- die "$(gettext "error: cannot combine merge options (--merge, --strategy, --strategy-option) with am options ($incompatible_opts)")"
- fi
+ die "$(gettext "fatal: cannot combine am options with either interactive or merge options")"
fi
fi
if test -n "$signoff"
then
test -n "$preserve_merges" &&
- die "$(gettext "error: cannot combine '--signoff' with '--preserve-merges'")"
+ die "$(gettext "fatal: cannot combine '--signoff' with '--preserve-merges'")"
git_am_opt="$git_am_opt $signoff"
force_rebase=t
fi
# Note: incompatibility with --interactive is just a strong warning;
# git-rebase.txt caveats with "unless you know what you are doing"
test -n "$rebase_merges" &&
- die "$(gettext "error: cannot combine '--preserve-merges' with '--rebase-merges'")"
+ die "$(gettext "fatal: cannot combine '--preserve-merges' with '--rebase-merges'")"
test -n "$reschedule_failed_exec" &&
die "$(gettext "error: cannot combine '--preserve-merges' with '--reschedule-failed-exec'")"
if test -n "$rebase_merges"
then
test -n "$strategy_opts" &&
- die "$(gettext "error: cannot combine '--rebase-merges' with '--strategy-option'")"
+ die "$(gettext "fatal: cannot combine '--rebase-merges' with '--strategy-option'")"
test -n "$strategy" &&
- die "$(gettext "error: cannot combine '--rebase-merges' with '--strategy'")"
+ die "$(gettext "fatal: cannot combine '--rebase-merges' with '--strategy'")"
fi
if test -z "$rebase_root"
# but this should be done only when upstream and onto are the same
# and if this is not an interactive rebase.
mb=$(git merge-base "$onto" "$orig_head")
-if test -z "$interactive_rebase" && test "$upstream" = "$onto" &&
+if test -z "$actually_interactive" && test "$upstream" = "$onto" &&
test "$mb" = "$onto" && test -z "$restrict_revision" &&
# linear history?
! (git rev-list --parents "$onto".."$orig_head" | sane_grep " .* ") > /dev/null
GIT_PAGER='' git diff --stat --summary "$mb_tree" "$onto"
fi
+if test -z "$actually_interactive" && test "$mb" = "$orig_head"
+then
+ say "$(eval_gettext "Fast-forwarded \$branch_name to \$onto_name.")"
+ GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $onto_name" \
+ git checkout -q "$onto^0" || die "could not detach HEAD"
+ # If the $onto is a proper descendant of the tip of the branch, then
+ # we just fast-forwarded.
+ git update-ref ORIG_HEAD $orig_head
+ move_to_original_branch
+ finish_rebase
+ exit 0
+fi
+
test -n "$interactive_rebase" && run_specific_rebase
# Detach HEAD and reset the tree
git checkout -q "$onto^0" || die "could not detach HEAD"
git update-ref ORIG_HEAD $orig_head
-# If the $onto is a proper descendant of the tip of the branch, then
-# we just fast-forwarded.
-if test "$mb" = "$orig_head"
-then
- say "$(eval_gettext "Fast-forwarded \$branch_name to \$onto_name.")"
- move_to_original_branch
- finish_rebase
- exit 0
-fi
-
if test -n "$rebase_root"
then
revisions="$onto..$orig_head"
git format-patch -k --stdout --full-index --cherry-pick --right-only \
--src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
- --pretty=mboxrd \
+ --pretty=mboxrd --topo-order \
$git_format_patch_opt \
"$revisions" ${restrict_revision+^$restrict_revision} \
>"$GIT_DIR/rebased-patches"
echo "$head_name" > "$state_dir"/head-name &&
echo "$onto" > "$state_dir"/onto &&
echo "$orig_head" > "$state_dir"/orig-head &&
- echo "$GIT_QUIET" > "$state_dir"/quiet &&
+ test t = "$GIT_QUIET" && : > "$state_dir"/quiet
test t = "$verbose" && : > "$state_dir"/verbose
test -n "$strategy" && echo "$strategy" > "$state_dir"/strategy
test -n "$strategy_opts" && echo "$strategy_opts" > \
+++ /dev/null
-# This shell script fragment is sourced by git-rebase to implement
-# its merge-based non-interactive mode that copes well with renamed
-# files.
-#
-# Copyright (c) 2010 Junio C Hamano.
-#
-
-prec=4
-
-read_state () {
- onto_name=$(cat "$state_dir"/onto_name) &&
- end=$(cat "$state_dir"/end) &&
- msgnum=$(cat "$state_dir"/msgnum)
-}
-
-continue_merge () {
- test -d "$state_dir" || die "$state_dir directory does not exist"
-
- unmerged=$(git ls-files -u)
- if test -n "$unmerged"
- then
- echo "You still have unmerged paths in your index"
- echo "did you forget to use git add?"
- die "$resolvemsg"
- fi
-
- cmt=$(cat "$state_dir/current")
- if ! git diff-index --quiet --ignore-submodules HEAD --
- then
- if ! git commit ${gpg_sign_opt:+"$gpg_sign_opt"} $signoff $allow_empty_message \
- --no-verify -C "$cmt"
- then
- echo "Commit failed, please do not call \"git commit\""
- echo "directly, but instead do one of the following: "
- die "$resolvemsg"
- fi
- if test -z "$GIT_QUIET"
- then
- printf "Committed: %0${prec}d " $msgnum
- fi
- echo "$cmt $(git rev-parse HEAD^0)" >> "$state_dir/rewritten"
- else
- if test -z "$GIT_QUIET"
- then
- printf "Already applied: %0${prec}d " $msgnum
- fi
- fi
- test -z "$GIT_QUIET" &&
- GIT_PAGER='' git log --format=%s -1 "$cmt"
-
- # onto the next patch:
- msgnum=$(($msgnum + 1))
- echo "$msgnum" >"$state_dir/msgnum"
-}
-
-call_merge () {
- msgnum="$1"
- echo "$msgnum" >"$state_dir/msgnum"
- cmt="$(cat "$state_dir/cmt.$msgnum")"
- echo "$cmt" > "$state_dir/current"
- git update-ref REBASE_HEAD "$cmt"
- hd=$(git rev-parse --verify HEAD)
- cmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD)
- eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"'
- eval GITHEAD_$hd='$onto_name'
- export GITHEAD_$cmt GITHEAD_$hd
- if test -n "$GIT_QUIET"
- then
- GIT_MERGE_VERBOSITY=1 && export GIT_MERGE_VERBOSITY
- fi
- test -z "$strategy" && strategy=recursive
- # If cmt doesn't have a parent, don't include it as a base
- base=$(git rev-parse --verify --quiet $cmt^)
- eval 'git merge-$strategy' $strategy_opts $base ' -- "$hd" "$cmt"'
- rv=$?
- case "$rv" in
- 0)
- unset GITHEAD_$cmt GITHEAD_$hd
- return
- ;;
- 1)
- git rerere $allow_rerere_autoupdate
- die "$resolvemsg"
- ;;
- 2)
- echo "Strategy: $strategy failed, try another" 1>&2
- die "$resolvemsg"
- ;;
- *)
- die "Unknown exit code ($rv) from command:" \
- "git merge-$strategy $cmt^ -- HEAD $cmt"
- ;;
- esac
-}
-
-finish_rb_merge () {
- move_to_original_branch
- if test -s "$state_dir"/rewritten
- then
- git notes copy --for-rewrite=rebase <"$state_dir"/rewritten
- hook="$(git rev-parse --git-path hooks/post-rewrite)"
- test -x "$hook" && "$hook" rebase <"$state_dir"/rewritten
- fi
- say All done.
-}
-
-git_rebase__merge () {
-
-case "$action" in
-continue)
- read_state
- continue_merge
- while test "$msgnum" -le "$end"
- do
- call_merge "$msgnum"
- continue_merge
- done
- finish_rb_merge
- return
- ;;
-skip)
- read_state
- git rerere clear
- msgnum=$(($msgnum + 1))
- while test "$msgnum" -le "$end"
- do
- call_merge "$msgnum"
- continue_merge
- done
- finish_rb_merge
- return
- ;;
-show-current-patch)
- exec git show REBASE_HEAD --
- ;;
-esac
-
-mkdir -p "$state_dir"
-echo "$onto_name" > "$state_dir/onto_name"
-write_basic_state
-rm -f "$(git rev-parse --git-path REBASE_HEAD)"
-
-msgnum=0
-for cmt in $(git rev-list --reverse --no-merges "$revisions")
-do
- msgnum=$(($msgnum + 1))
- echo "$cmt" > "$state_dir/cmt.$msgnum"
-done
-
-echo 1 >"$state_dir/msgnum"
-echo $msgnum >"$state_dir/end"
-
-end=$msgnum
-msgnum=1
-
-while test "$msgnum" -le "$end"
-do
- call_merge "$msgnum"
- continue_merge
-done
-
-finish_rb_merge
-
-}
static GIT_PATH_FUNC(rebase_path_gpg_sign_opt, "rebase-merge/gpg_sign_opt")
static GIT_PATH_FUNC(rebase_path_orig_head, "rebase-merge/orig-head")
static GIT_PATH_FUNC(rebase_path_verbose, "rebase-merge/verbose")
+static GIT_PATH_FUNC(rebase_path_quiet, "rebase-merge/quiet")
static GIT_PATH_FUNC(rebase_path_signoff, "rebase-merge/signoff")
static GIT_PATH_FUNC(rebase_path_head_name, "rebase-merge/head-name")
static GIT_PATH_FUNC(rebase_path_onto, "rebase-merge/onto")
static GIT_PATH_FUNC(rebase_path_strategy, "rebase-merge/strategy")
static GIT_PATH_FUNC(rebase_path_strategy_opts, "rebase-merge/strategy_opts")
static GIT_PATH_FUNC(rebase_path_allow_rerere_autoupdate, "rebase-merge/allow_rerere_autoupdate")
-static GIT_PATH_FUNC(rebase_path_quiet, "rebase-merge/quiet")
static GIT_PATH_FUNC(rebase_path_reschedule_failed_exec, "rebase-merge/reschedule-failed-exec")
static int git_sequencer_config(const char *k, const char *v, void *cb)
if (file_exists(rebase_path_verbose()))
opts->verbose = 1;
+ if (file_exists(rebase_path_quiet()))
+ opts->quiet = 1;
+
if (file_exists(rebase_path_signoff())) {
opts->allow_ff = 0;
opts->signoff = 1;
if (quiet)
write_file(rebase_path_quiet(), "%s\n", quiet);
- else
- write_file(rebase_path_quiet(), "\n");
-
if (opts->verbose)
write_file(rebase_path_verbose(), "%s", "");
if (opts->strategy)
fprintf(f, "%d\n", todo_list->done_nr);
fclose(f);
}
- fprintf(stderr, "Rebasing (%d/%d)%s",
- todo_list->done_nr,
- todo_list->total_nr,
- opts->verbose ? "\n" : "\r");
+ if (!opts->quiet)
+ fprintf(stderr, "Rebasing (%d/%d)%s",
+ todo_list->done_nr,
+ todo_list->total_nr,
+ opts->verbose ? "\n" : "\r");
}
unlink(rebase_path_message());
unlink(rebase_path_author_script());
}
apply_autostash(opts);
- fprintf(stderr, "Successfully rebased and updated %s.\n",
- head_ref.buf);
+ if (!opts->quiet)
+ fprintf(stderr,
+ "Successfully rebased and updated %s.\n",
+ head_ref.buf);
strbuf_release(&buf);
strbuf_release(&head_ref);
int allow_empty_message;
int keep_redundant_commits;
int verbose;
+ int quiet;
int reschedule_failed_exec;
int mainline;
git tag start
'
-cat >expect <<\EOF
-Already applied: 0001 A
-Already applied: 0002 B
-Committed: 0003 Z
-EOF
-
test_expect_success 'rebase -m' '
git rebase -m master >report &&
+ >expect &&
sed -n -e "/^Already applied: /p" \
-e "/^Committed: /p" report >actual &&
test_cmp expect actual
EOF
}
-create_expected_success_merge () {
- cat >expected <<-EOF
- $(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
- HEAD is now at $(git rev-parse --short feature-branch) third commit
- First, rewinding head to replay your work on top of it...
- Merging unrelated-onto-branch with HEAD~1
- Merging:
- $(git rev-parse --short unrelated-onto-branch) unrelated commit
- $(git rev-parse --short feature-branch^) second commit
- found 1 common ancestor:
- $(git rev-parse --short feature-branch~2) initial commit
- [detached HEAD $(git rev-parse --short rebased-feature-branch~1)] second commit
- Author: A U Thor <author@example.com>
- Date: Thu Apr 7 15:14:13 2005 -0700
- 2 files changed, 2 insertions(+)
- create mode 100644 file1
- create mode 100644 file2
- Committed: 0001 second commit
- Merging unrelated-onto-branch with HEAD~0
- Merging:
- $(git rev-parse --short rebased-feature-branch~1) second commit
- $(git rev-parse --short feature-branch) third commit
- found 1 common ancestor:
- $(git rev-parse --short feature-branch~1) second commit
- [detached HEAD $(git rev-parse --short rebased-feature-branch)] third commit
- Author: A U Thor <author@example.com>
- Date: Thu Apr 7 15:15:13 2005 -0700
- 1 file changed, 1 insertion(+)
- create mode 100644 file3
- Committed: 0002 third commit
- All done.
- Applied autostash.
- EOF
-}
-
create_expected_failure_am () {
cat >expected <<-EOF
$(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
EOF
}
-create_expected_failure_merge () {
- cat >expected <<-EOF
- $(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
- HEAD is now at $(git rev-parse --short feature-branch) third commit
- First, rewinding head to replay your work on top of it...
- Merging unrelated-onto-branch with HEAD~1
- Merging:
- $(git rev-parse --short unrelated-onto-branch) unrelated commit
- $(git rev-parse --short feature-branch^) second commit
- found 1 common ancestor:
- $(git rev-parse --short feature-branch~2) initial commit
- [detached HEAD $(git rev-parse --short rebased-feature-branch~1)] second commit
- Author: A U Thor <author@example.com>
- Date: Thu Apr 7 15:14:13 2005 -0700
- 2 files changed, 2 insertions(+)
- create mode 100644 file1
- create mode 100644 file2
- Committed: 0001 second commit
- Merging unrelated-onto-branch with HEAD~0
- Merging:
- $(git rev-parse --short rebased-feature-branch~1) second commit
- $(git rev-parse --short feature-branch) third commit
- found 1 common ancestor:
- $(git rev-parse --short feature-branch~1) second commit
- [detached HEAD $(git rev-parse --short rebased-feature-branch)] third commit
- Author: A U Thor <author@example.com>
- Date: Thu Apr 7 15:15:13 2005 -0700
- 1 file changed, 1 insertion(+)
- create mode 100644 file3
- Committed: 0002 third commit
- All done.
- Applying autostash resulted in conflicts.
- Your changes are safe in the stash.
- You can run "git stash pop" or "git stash drop" at any time.
- EOF
-}
-
testrebase () {
type=$1
dotest=$2
test_expect_success "rebase$type --autostash: check output" '
test_when_finished git branch -D rebased-feature-branch &&
suffix=${type#\ --} && suffix=${suffix:-am} &&
+ if test ${suffix} = "merge"; then
+ suffix=interactive
+ fi &&
create_expected_success_$suffix &&
test_i18ncmp expected actual
'
test_expect_success "rebase$type: check output with conflicting stash" '
test_when_finished git branch -D rebased-feature-branch &&
suffix=${type#\ --} && suffix=${suffix:-am} &&
+ if test ${suffix} = "merge"; then
+ suffix=interactive
+ fi &&
create_expected_failure_$suffix &&
test_i18ncmp expected actual
'
"
}
test_run_rebase success ''
-test_run_rebase failure -m
+test_run_rebase success -m
test_run_rebase success -i
test_have_prereq !REBASE_P || test_run_rebase success -p
"
}
test_run_rebase success ''
-test_run_rebase failure -m
+test_run_rebase success -m
test_run_rebase success -i
test_have_prereq !REBASE_P || test_run_rebase success -p
"
}
test_run_rebase success ''
-test_run_rebase failure -m
+test_run_rebase success -m
test_run_rebase success -i
test_have_prereq !REBASE_P || test_run_rebase success -p
"
}
test_run_rebase success ''
-test_run_rebase failure -m
+test_run_rebase success -m
test_run_rebase success -i
test_have_prereq !REBASE_P || test_run_rebase success -p
"
}
test_run_rebase success ''
-test_run_rebase failure -m
+test_run_rebase success -m
test_run_rebase success -i
test_have_prereq !REBASE_P || test_run_rebase failure -p
test_linear_range "\'"$expected"\'" d..
"
}
-#TODO: make order consistent across all flavors of rebase
-test_run_rebase success 'e n o' ''
-test_run_rebase success 'e n o' -m
+test_run_rebase success 'n o e' ''
+test_run_rebase success 'n o e' -m
test_run_rebase success 'n o e' -i
test_run_rebase () {
test_linear_range "\'"$expected"\'" c..
"
}
-#TODO: make order consistent across all flavors of rebase
-test_run_rebase success 'd e n o' ''
-test_run_rebase success 'd e n o' -m
+test_run_rebase success 'd n o e' ''
+test_run_rebase success 'd n o e' -m
test_run_rebase success 'd n o e' -i
test_run_rebase () {
test_linear_range "\'"$expected"\'" c..
"
}
-#TODO: make order consistent across all flavors of rebase
-test_run_rebase success 'd e n o' ''
-test_run_rebase success 'd e n o' -m
+test_run_rebase success 'd n o e' ''
+test_run_rebase success 'd n o e' -m
test_run_rebase success 'd n o e' -i
if ! test_have_prereq REBASE_P; then
git rebase --continue &&
echo rebase >expected.args &&
cat >expected.data <<-EOF &&
+ $(git rev-parse C) $(git rev-parse HEAD^)
$(git rev-parse D) $(git rev-parse HEAD)
EOF
verify_hook_input
echo rebase >expected.args &&
cat >expected.data <<-EOF &&
$(git rev-parse E) $(git rev-parse HEAD)
+ $(git rev-parse F) $(git rev-parse HEAD)
EOF
verify_hook_input
'
git rebase --continue &&
echo rebase >expected.args &&
cat >expected.data <<-EOF &&
+ $(git rev-parse C) $(git rev-parse HEAD^)
+ $(git rev-parse D) $(git rev-parse HEAD)
+ EOF
+ verify_hook_input
+'
+
+test_expect_success 'git rebase with implicit use of interactive backend' '
+ git reset --hard D &&
+ clear_hook_input &&
+ test_must_fail git rebase --keep --onto A B &&
+ echo C > foo &&
+ git add foo &&
+ git rebase --continue &&
+ echo rebase >expected.args &&
+ cat >expected.data <<-EOF &&
+ $(git rev-parse C) $(git rev-parse HEAD^)
+ $(git rev-parse D) $(git rev-parse HEAD)
+ EOF
+ verify_hook_input
+'
+
+test_expect_success 'git rebase --skip with implicit use of interactive backend' '
+ git reset --hard D &&
+ clear_hook_input &&
+ test_must_fail git rebase --keep --onto A B &&
+ test_must_fail git rebase --skip &&
+ echo D > foo &&
+ git add foo &&
+ git rebase --continue &&
+ echo rebase >expected.args &&
+ cat >expected.data <<-EOF &&
+ $(git rev-parse C) $(git rev-parse HEAD^)
$(git rev-parse D) $(git rev-parse HEAD)
EOF
verify_hook_input
'
test_expect_success 'prompt - rebase merge' '
- printf " (b2|REBASE-m 1/3)" >expected &&
+ printf " (b2|REBASE-i 1/3)" >expected &&
git checkout b2 &&
test_when_finished "git checkout master" &&
test_must_fail git rebase --merge b1 b2 &&