Skip to content

Commit 72ee673

Browse files
newrengitster
authored andcommitted
rebase: fix incompatible options error message
In commit f576968 ("rebase: really just passthru the `git am` options", 2018-11-14), the handling of `git am` options was simplified dramatically (and an option parsing bug was fixed), but it introduced a small regression in the error message shown when options only understood by separate backends were used: $ git rebase --keep --ignore-whitespace fatal: cannot combine interactive options (--interactive, --exec, --rebase-merges, --preserve-merges, --keep-empty, --root + --onto) with am options (.git/rebase-apply/applying) $ git rebase --merge --ignore-whitespace fatal: cannot combine merge options (--merge, --strategy, --strategy-option) with am options (.git/rebase-apply/applying) Note that in both cases, the list of "am options" is ".git/rebase-apply/applying", which makes no sense. Since the lists of backend-specific options is documented pretty thoroughly in the rebase man page (in the "Incompatible Options" section, with multiple links throughout the document), and since I expect this list to change over time, just simplify the error message. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c913c59 commit 72ee673

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

builtin/rebase.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,14 +1223,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
12231223
break;
12241224

12251225
if (is_interactive(&options) && i >= 0)
1226-
die(_("cannot combine interactive options "
1227-
"(--interactive, --exec, --rebase-merges, "
1228-
"--preserve-merges, --keep-empty, --root + "
1229-
"--onto) with am options (%s)"), buf.buf);
1226+
die(_("cannot combine am options "
1227+
"with interactive options"));
12301228
if (options.type == REBASE_MERGE && i >= 0)
1231-
die(_("cannot combine merge options (--merge, "
1232-
"--strategy, --strategy-option) with am options "
1233-
"(%s)"), buf.buf);
1229+
die(_("cannot combine am options with merge options "));
12341230
}
12351231

12361232
if (options.signoff) {

git-legacy-rebase.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,13 @@ if test -n "$git_am_opt"; then
508508
then
509509
if test -n "$incompatible_opts"
510510
then
511-
die "$(gettext "fatal: cannot combine interactive options (--interactive, --exec, --rebase-merges, --preserve-merges, --keep-empty, --root + --onto) with am options ($incompatible_opts)")"
511+
die "$(gettext "fatal: cannot combine am options with interactive options")"
512512
fi
513513
fi
514514
if test -n "$do_merge"; then
515515
if test -n "$incompatible_opts"
516516
then
517-
die "$(gettext "fatal: cannot combine merge options (--merge, --strategy, --strategy-option) with am options ($incompatible_opts)")"
517+
die "$(gettext "fatal: cannot combine am options with merge options")"
518518
fi
519519
fi
520520
fi

0 commit comments

Comments
 (0)