Revert "rebase: introduce a shortcut for --reschedule-failed-exec"
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 6 Feb 2019 18:45:17 +0000 (10:45 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Feb 2019 19:27:17 +0000 (11:27 -0800)
This patch was contributed only as a tentative "we could introduce a
convenient short option if we do not want to change the default behavior
in the long run" patch, opening the discussion whether other people
agree with deprecating the current behavior in favor of the rescheduling
behavior.

But the consensus on the Git mailing list was that it would make sense
to show a warning in the near future, and flip the default
rebase.rescheduleFailedExec to reschedule failed `exec` commands by
default. See e.g.
<CAGZ79kZL5CRqCDRb6B-EedUm8Z_i4JuSF2=UtwwdRXMitrrOBw@mail.gmail.com>

So let's back out that patch that added the `-y` short option that we
agreed was not necessary or desirable.

This reverts commit 81ef8ee75d5f348d3c71ff633d13d302124e1a5e.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rebase.txt
builtin/rebase.c
git-legacy-rebase.sh
t/t3418-rebase-continue.sh
index 98f60b2be0f0c91a515cf513a5e020d6da1eba69..174be5b1f0a4963cdb954df1b9cba7f01ed0b286 100644 (file)
@@ -462,12 +462,6 @@ without an explicit `--interactive`.
 +
 See also INCOMPATIBLE OPTIONS below.
 
--y <cmd>::
-       This is the same as passing `--reschedule-failed-exec` before
-       `-x <cmd>`, i.e. it appends the specified `exec` command and
-       turns on the mode where failed `exec` commands are automatically
-       rescheduled.
-
 --root::
        Rebase all commits reachable from <branch>, instead of
        limiting them with an <upstream>.  This allows you to rebase
index 1963076f6064456f1e89b286458bd78de8934ddf..4839e525558bfea819d710cc40ab483eb80fcdf6 100644 (file)
@@ -754,23 +754,6 @@ static int parse_opt_interactive(const struct option *opt, const char *arg,
        return 0;
 }
 
-struct opt_y {
-       struct string_list *list;
-       struct rebase_options *options;
-};
-
-static int parse_opt_y(const struct option *opt, const char *arg, int unset)
-{
-       struct opt_y *o = opt->value;
-
-       if (unset || !arg)
-               return -1;
-
-       o->options->reschedule_failed_exec = 1;
-       string_list_append(o->list, arg);
-       return 0;
-}
-
 static void NORETURN error_on_missing_default_upstream(void)
 {
        struct branch *current_branch = branch_get(NULL);
@@ -851,7 +834,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
        struct string_list strategy_options = STRING_LIST_INIT_NODUP;
        struct object_id squash_onto;
        char *squash_onto_name = NULL;
-       struct opt_y opt_y = { .list = &exec, .options = &options };
        struct option builtin_rebase_options[] = {
                OPT_STRING(0, "onto", &options.onto_name,
                           N_("revision"),
@@ -929,9 +911,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                OPT_STRING_LIST('x', "exec", &exec, N_("exec"),
                                N_("add exec lines after each commit of the "
                                   "editable list")),
-               { OPTION_CALLBACK, 'y', NULL, &opt_y, N_("<cmd>"),
-                       N_("same as --reschedule-failed-exec -x <cmd>"),
-                       PARSE_OPT_NONEG, parse_opt_y },
                OPT_BOOL(0, "allow-empty-message",
                         &options.allow_empty_message,
                         N_("allow rebasing commits with empty messages")),
index 3bb0682db5897f514d267946979fa2b9cfa43f20..37db5a7ca4618be80009c7a691c02c6044ce5dd4 100755 (executable)
@@ -26,7 +26,6 @@ f,force-rebase!    cherry-pick all commits, even if unchanged
 m,merge!           use merging strategies to rebase
 i,interactive!     let the user edit the list of commits to rebase
 x,exec=!           add exec lines after each commit of the editable list
-y=!                same as --reschedule-failed-exec -x
 k,keep-empty      preserve empty commits during rebase
 allow-empty-message allow rebasing commits with empty messages
 stat!              display a diffstat of what changed upstream
@@ -263,11 +262,6 @@ do
                cmd="${cmd}exec ${1#--exec=}${LF}"
                test -z "$interactive_rebase" && interactive_rebase=implied
                ;;
-       -y*)
-               reschedule_failed_exec=--reschedule-failed-exec
-               cmd="${cmd}exec ${1#-y}${LF}"
-               test -z "$interactive_rebase" && interactive_rebase=implied
-               ;;
        --interactive)
                interactive_rebase=explicit
                ;;
index 25aaacacfc6b7beb1e29b73678777a76c6af9f71..bdaa511bb0ae1082568e83781252f667b39cda8a 100755 (executable)
@@ -262,9 +262,6 @@ test_expect_success '--reschedule-failed-exec' '
        test_must_fail git -c rebase.rescheduleFailedExec=true \
                rebase -x false HEAD^ 2>err &&
        grep "^exec false" .git/rebase-merge/git-rebase-todo &&
-       test_i18ngrep "has been rescheduled" err &&
-       git rebase --abort &&
-       test_must_fail git rebase -y false HEAD^ 2>err &&
        test_i18ngrep "has been rescheduled" err
 '