i18n: turn even more messages into "cannot be used together" ones

Even if some of these messages are not subject to gettext i18n, this
helps bring a single style of message for a given error type.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jean-Noël Avila
2022-01-05 20:02:24 +00:00
committed by Junio C Hamano
parent d7d30badbf
commit 246cac8505
23 changed files with 47 additions and 41 deletions

View File

@ -361,7 +361,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "-a");
if (pathspec.nr)
die(_("--pathspec-from-file is incompatible with pathspec arguments"));
die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
parse_pathspec_file(&pathspec, 0,
PATHSPEC_PREFER_FULL,
@ -799,7 +799,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (!strcmp(fixup_prefix, "amend")) {
if (have_option_m)
die(_("cannot combine -m with --fixup:%s"), fixup_message);
die(_("options '%s' and '%s:%s' cannot be used together"), "-m", "--fixup", fixup_message);
prepare_amend_commit(commit, &sb, &ctx);
}
} else if (!stat(git_path_merge_msg(the_repository), &statbuf)) {
@ -1229,9 +1229,10 @@ static void check_fixup_reword_options(int argc, const char *argv[]) {
die(_("You are in the middle of a cherry-pick -- cannot reword."));
}
if (argc)
die(_("cannot combine reword option of --fixup with path '%s'"), *argv);
die(_("reword option of '%s' and path '%s' cannot be used together"), "--fixup", *argv);
if (patch_interactive || interactive || all || also || only)
die(_("reword option of --fixup is mutually exclusive with --patch/--interactive/--all/--include/--only"));
die(_("reword option of '%s' and '%s' cannot be used together"),
"--fixup", "--patch/--interactive/--all/--include/--only");
}
static int parse_and_validate_options(int argc, const char *argv[],