Skip to content

Commit c913c59

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d0ac38 commit c913c59

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

builtin/rebase.c

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

12251225
if (is_interactive(&options) && i >= 0)
1226-
die(_("error: cannot combine interactive options "
1226+
die(_("cannot combine interactive options "
12271227
"(--interactive, --exec, --rebase-merges, "
12281228
"--preserve-merges, --keep-empty, --root + "
12291229
"--onto) with am options (%s)"), buf.buf);
12301230
if (options.type == REBASE_MERGE && i >= 0)
1231-
die(_("error: cannot combine merge options (--merge, "
1231+
die(_("cannot combine merge options (--merge, "
12321232
"--strategy, --strategy-option) with am options "
12331233
"(%s)"), buf.buf);
12341234
}
@@ -1248,15 +1248,15 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
12481248
* git-rebase.txt caveats with "unless you know what you are doing"
12491249
*/
12501250
if (options.rebase_merges)
1251-
die(_("error: cannot combine '--preserve-merges' with "
1251+
die(_("cannot combine '--preserve-merges' with "
12521252
"'--rebase-merges'"));
12531253

12541254
if (options.rebase_merges) {
12551255
if (strategy_options.nr)
1256-
die(_("error: cannot combine '--rebase-merges' with "
1256+
die(_("cannot combine '--rebase-merges' with "
12571257
"'--strategy-option'"));
12581258
if (options.strategy)
1259-
die(_("error: cannot combine '--rebase-merges' with "
1259+
die(_("cannot combine '--rebase-merges' with "
12601260
"'--strategy'"));
12611261
}
12621262

git-legacy-rebase.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -508,21 +508,21 @@ if test -n "$git_am_opt"; then
508508
then
509509
if test -n "$incompatible_opts"
510510
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)")"
512512
fi
513513
fi
514514
if test -n "$do_merge"; then
515515
if test -n "$incompatible_opts"
516516
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)")"
518518
fi
519519
fi
520520
fi
521521

522522
if test -n "$signoff"
523523
then
524524
test -n "$preserve_merges" &&
525-
die "$(gettext "error: cannot combine '--signoff' with '--preserve-merges'")"
525+
die "$(gettext "fatal: cannot combine '--signoff' with '--preserve-merges'")"
526526
git_am_opt="$git_am_opt $signoff"
527527
force_rebase=t
528528
fi
@@ -533,15 +533,15 @@ then
533533
# Note: incompatibility with --interactive is just a strong warning;
534534
# git-rebase.txt caveats with "unless you know what you are doing"
535535
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'")"
537537
fi
538538

539539
if test -n "$rebase_merges"
540540
then
541541
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'")"
543543
test -n "$strategy" &&
544-
die "$(gettext "error: cannot combine '--rebase-merges' with '--strategy'")"
544+
die "$(gettext "fatal: cannot combine '--rebase-merges' with '--strategy'")"
545545
fi
546546

547547
if test -z "$rebase_root"

0 commit comments

Comments
 (0)