rebase: make builtin and legacy script error messages the same

The conversion of the script version of rebase took messages that were prefixed with "error:" and passed them along to die(), which adds a "fatal:" prefix, thus resulting in messages of the form: fatal: error: cannot combine... which seems redundant. Remove the "error:" prefix from the builtin version of rebase, and change the prefix from "error:" to "fatal:" in the legacy script to match. 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 c913c5964c3a7b5158a76c02721acbd0df6e2b40
2 files changed +11 -11
builtin/rebase.c
+5 -5
@@ -1223,12 +1223,12 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
1223 break;
1224
1225 if (is_interactive(&options) && i >= 0)
1226 - die(_("error: cannot combine interactive options "
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);
1230 if (options.type == REBASE_MERGE && i >= 0)
1231 - die(_("error: cannot combine merge options (--merge, "
1231 + die(_("cannot combine merge options (--merge, "
1232 "--strategy, --strategy-option) with am options "
1233 "(%s)"), buf.buf);
1234 }
@@ -1248,15 +1248,15 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
1248 * git-rebase.txt caveats with "unless you know what you are doing"
1249 */
1250 if (options.rebase_merges)
1251 - die(_("error: cannot combine '--preserve-merges' with "
1251 + die(_("cannot combine '--preserve-merges' with "
1252 "'--rebase-merges'"));
1253
1254 if (options.rebase_merges) {
1255 if (strategy_options.nr)
1256 - die(_("error: cannot combine '--rebase-merges' with "
1256 + die(_("cannot combine '--rebase-merges' with "
1257 "'--strategy-option'"));
1258 if (options.strategy)
1259 - die(_("error: cannot combine '--rebase-merges' with "
1259 + die(_("cannot combine '--rebase-merges' with "
1260 "'--strategy'"));
1261 }
1262
git-legacy-rebase.sh
+6 -6
@@ -508,13 +508,13 @@ if test -n "$git_am_opt"; then
508 then
509 if test -n "$incompatible_opts"
510 then
511 - die "$(gettext "error: 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 interactive options (--interactive, --exec, --rebase-merges, --preserve-merges, --keep-empty, --root + --onto) with am options ($incompatible_opts)")"
512 fi
513 fi
514 if test -n "$do_merge"; then
515 if test -n "$incompatible_opts"
516 then
517 - die "$(gettext "error: cannot combine merge options (--merge, --strategy, --strategy-option) with am options ($incompatible_opts)")"
517 + die "$(gettext "fatal: cannot combine merge options (--merge, --strategy, --strategy-option) with am options ($incompatible_opts)")"
518 fi
519 fi
520 fi
@@ -522,7 +522,7 @@ fi
522 if test -n "$signoff"
523 then
524 test -n "$preserve_merges" &&
525 - die "$(gettext "error: cannot combine '--signoff' with '--preserve-merges'")"
525 + die "$(gettext "fatal: cannot combine '--signoff' with '--preserve-merges'")"
526 git_am_opt="$git_am_opt $signoff"
527 force_rebase=t
528 fi
@@ -533,15 +533,15 @@ then
533 # Note: incompatibility with --interactive is just a strong warning;
534 # git-rebase.txt caveats with "unless you know what you are doing"
535 test -n "$rebase_merges" &&
536 - die "$(gettext "error: cannot combine '--preserve-merges' with '--rebase-merges'")"
536 + die "$(gettext "fatal: cannot combine '--preserve-merges' with '--rebase-merges'")"
537 fi
538
539 if test -n "$rebase_merges"
540 then
541 test -n "$strategy_opts" &&
542 - die "$(gettext "error: cannot combine '--rebase-merges' with '--strategy-option'")"
542 + die "$(gettext "fatal: cannot combine '--rebase-merges' with '--strategy-option'")"
543 test -n "$strategy" &&
544 - die "$(gettext "error: cannot combine '--rebase-merges' with '--strategy'")"
544 + die "$(gettext "fatal: cannot combine '--rebase-merges' with '--strategy'")"
545 fi
546
547 if test -z "$rebase_root"