rebase: fix incompatible options error message

In commit f57696802c30 ("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 <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Dec 11, 2018 at 08:11 UTC 72ee67319f703201631b33697291720afd4e1d66
2 files changed +5 -9
builtin/rebase.c
+3 -7
@@ -1223,14 +1223,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
1223 break;
1224
1225 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"));
1228 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 "));
1230 }
1231
1232 if (options.signoff) {
git-legacy-rebase.sh
+2 -2
@@ -508,13 +508,13 @@ if test -n "$git_am_opt"; then
508 then
509 if test -n "$incompatible_opts"
510 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")"
512 fi
513 fi
514 if test -n "$do_merge"; then
515 if test -n "$incompatible_opts"
516 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")"
518 fi
519 fi
520 fi