Skip to content

Commit e11ff89

Browse files
dschogitster
authored andcommitted
Revert "rebase: introduce a shortcut for --reschedule-failed-exec"
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 81ef8ee. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 81ef8ee commit e11ff89

File tree

4 files changed

+0
-36
lines changed

4 files changed

+0
-36
lines changed

Documentation/git-rebase.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,6 @@ without an explicit `--interactive`.
462462
+
463463
See also INCOMPATIBLE OPTIONS below.
464464

465-
-y <cmd>::
466-
This is the same as passing `--reschedule-failed-exec` before
467-
`-x <cmd>`, i.e. it appends the specified `exec` command and
468-
turns on the mode where failed `exec` commands are automatically
469-
rescheduled.
470-
471465
--root::
472466
Rebase all commits reachable from <branch>, instead of
473467
limiting them with an <upstream>. This allows you to rebase

builtin/rebase.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -754,23 +754,6 @@ static int parse_opt_interactive(const struct option *opt, const char *arg,
754754
return 0;
755755
}
756756

757-
struct opt_y {
758-
struct string_list *list;
759-
struct rebase_options *options;
760-
};
761-
762-
static int parse_opt_y(const struct option *opt, const char *arg, int unset)
763-
{
764-
struct opt_y *o = opt->value;
765-
766-
if (unset || !arg)
767-
return -1;
768-
769-
o->options->reschedule_failed_exec = 1;
770-
string_list_append(o->list, arg);
771-
return 0;
772-
}
773-
774757
static void NORETURN error_on_missing_default_upstream(void)
775758
{
776759
struct branch *current_branch = branch_get(NULL);
@@ -851,7 +834,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
851834
struct string_list strategy_options = STRING_LIST_INIT_NODUP;
852835
struct object_id squash_onto;
853836
char *squash_onto_name = NULL;
854-
struct opt_y opt_y = { .list = &exec, .options = &options };
855837
struct option builtin_rebase_options[] = {
856838
OPT_STRING(0, "onto", &options.onto_name,
857839
N_("revision"),
@@ -929,9 +911,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
929911
OPT_STRING_LIST('x', "exec", &exec, N_("exec"),
930912
N_("add exec lines after each commit of the "
931913
"editable list")),
932-
{ OPTION_CALLBACK, 'y', NULL, &opt_y, N_("<cmd>"),
933-
N_("same as --reschedule-failed-exec -x <cmd>"),
934-
PARSE_OPT_NONEG, parse_opt_y },
935914
OPT_BOOL(0, "allow-empty-message",
936915
&options.allow_empty_message,
937916
N_("allow rebasing commits with empty messages")),

git-legacy-rebase.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ f,force-rebase! cherry-pick all commits, even if unchanged
2626
m,merge! use merging strategies to rebase
2727
i,interactive! let the user edit the list of commits to rebase
2828
x,exec=! add exec lines after each commit of the editable list
29-
y=! same as --reschedule-failed-exec -x
3029
k,keep-empty preserve empty commits during rebase
3130
allow-empty-message allow rebasing commits with empty messages
3231
stat! display a diffstat of what changed upstream
@@ -263,11 +262,6 @@ do
263262
cmd="${cmd}exec ${1#--exec=}${LF}"
264263
test -z "$interactive_rebase" && interactive_rebase=implied
265264
;;
266-
-y*)
267-
reschedule_failed_exec=--reschedule-failed-exec
268-
cmd="${cmd}exec ${1#-y}${LF}"
269-
test -z "$interactive_rebase" && interactive_rebase=implied
270-
;;
271265
--interactive)
272266
interactive_rebase=explicit
273267
;;

t/t3418-rebase-continue.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ test_expect_success '--reschedule-failed-exec' '
262262
test_must_fail git -c rebase.rescheduleFailedExec=true \
263263
rebase -x false HEAD^ 2>err &&
264264
grep "^exec false" .git/rebase-merge/git-rebase-todo &&
265-
test_i18ngrep "has been rescheduled" err &&
266-
git rebase --abort &&
267-
test_must_fail git rebase -y false HEAD^ 2>err &&
268265
test_i18ngrep "has been rescheduled" err
269266
'
270267

0 commit comments

Comments
 (0)