Skip to content

Commit

Permalink
rebase: make builtin and legacy script error messages the same
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
newren authored and gitster committed Dec 28, 2018
1 parent 0d0ac38 commit c913c59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions builtin/rebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,12 +1223,12 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
break;

if (is_interactive(&options) && i >= 0)
die(_("error: cannot combine interactive options "
die(_("cannot combine interactive options "
"(--interactive, --exec, --rebase-merges, "
"--preserve-merges, --keep-empty, --root + "
"--onto) with am options (%s)"), buf.buf);
if (options.type == REBASE_MERGE && i >= 0)
die(_("error: cannot combine merge options (--merge, "
die(_("cannot combine merge options (--merge, "
"--strategy, --strategy-option) with am options "
"(%s)"), buf.buf);
}
Expand All @@ -1248,15 +1248,15 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
* git-rebase.txt caveats with "unless you know what you are doing"
*/
if (options.rebase_merges)
die(_("error: cannot combine '--preserve-merges' with "
die(_("cannot combine '--preserve-merges' with "
"'--rebase-merges'"));

if (options.rebase_merges) {
if (strategy_options.nr)
die(_("error: cannot combine '--rebase-merges' with "
die(_("cannot combine '--rebase-merges' with "
"'--strategy-option'"));
if (options.strategy)
die(_("error: cannot combine '--rebase-merges' with "
die(_("cannot combine '--rebase-merges' with "
"'--strategy'"));
}

Expand Down
12 changes: 6 additions & 6 deletions git-legacy-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -508,21 +508,21 @@ if test -n "$git_am_opt"; then
then
if test -n "$incompatible_opts"
then
die "$(gettext "error: cannot combine interactive options (--interactive, --exec, --rebase-merges, --preserve-merges, --keep-empty, --root + --onto) with am options ($incompatible_opts)")"
die "$(gettext "fatal: cannot combine interactive options (--interactive, --exec, --rebase-merges, --preserve-merges, --keep-empty, --root + --onto) with am options ($incompatible_opts)")"
fi
fi
if test -n "$do_merge"; then
if test -n "$incompatible_opts"
then
die "$(gettext "error: cannot combine merge options (--merge, --strategy, --strategy-option) with am options ($incompatible_opts)")"
die "$(gettext "fatal: cannot combine merge options (--merge, --strategy, --strategy-option) with am options ($incompatible_opts)")"
fi
fi
fi

if test -n "$signoff"
then
test -n "$preserve_merges" &&
die "$(gettext "error: cannot combine '--signoff' with '--preserve-merges'")"
die "$(gettext "fatal: cannot combine '--signoff' with '--preserve-merges'")"
git_am_opt="$git_am_opt $signoff"
force_rebase=t
fi
Expand All @@ -533,15 +533,15 @@ then
# Note: incompatibility with --interactive is just a strong warning;
# git-rebase.txt caveats with "unless you know what you are doing"
test -n "$rebase_merges" &&
die "$(gettext "error: cannot combine '--preserve-merges' with '--rebase-merges'")"
die "$(gettext "fatal: cannot combine '--preserve-merges' with '--rebase-merges'")"
fi

if test -n "$rebase_merges"
then
test -n "$strategy_opts" &&
die "$(gettext "error: cannot combine '--rebase-merges' with '--strategy-option'")"
die "$(gettext "fatal: cannot combine '--rebase-merges' with '--strategy-option'")"
test -n "$strategy" &&
die "$(gettext "error: cannot combine '--rebase-merges' with '--strategy'")"
die "$(gettext "fatal: cannot combine '--rebase-merges' with '--strategy'")"
fi

if test -z "$rebase_root"
Expand Down

0 comments on commit c913c59

Please sign in to comment.