summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c14
-rw-r--r--builtin/am.c6
-rw-r--r--builtin/branch.c2
-rw-r--r--builtin/cat-file.c2
-rw-r--r--builtin/checkout.c18
-rw-r--r--builtin/clone.c6
-rw-r--r--builtin/commit.c17
-rw-r--r--builtin/describe.c6
-rw-r--r--builtin/diff-tree.c2
-rw-r--r--builtin/difftool.c4
-rw-r--r--builtin/fast-export.c4
-rw-r--r--builtin/fetch.c8
-rw-r--r--builtin/index-pack.c4
-rw-r--r--builtin/init-db.c2
-rw-r--r--builtin/log.c8
-rw-r--r--builtin/ls-files.c2
-rw-r--r--builtin/merge.c4
-rw-r--r--builtin/pack-objects.c2
-rw-r--r--builtin/push.c8
-rw-r--r--builtin/rebase.c10
-rw-r--r--builtin/repack.c4
-rw-r--r--builtin/reset.c10
-rw-r--r--builtin/rev-list.c4
-rw-r--r--builtin/rm.c4
-rw-r--r--builtin/show-branch.c4
-rw-r--r--builtin/stash.c8
-rw-r--r--builtin/submodule--helper.c4
-rw-r--r--builtin/tag.c27
-rw-r--r--builtin/worktree.c6
29 files changed, 103 insertions, 97 deletions
diff --git a/builtin/add.c b/builtin/add.c
index a010b2c325..84dff3e796 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -507,9 +507,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
add_interactive = 1;
if (add_interactive) {
if (show_only)
- die(_("--dry-run is incompatible with --interactive/--patch"));
+ die(_("options '%s' and '%s' cannot be used together"), "--dry-run", "--interactive/--patch");
if (pathspec_from_file)
- die(_("--pathspec-from-file is incompatible with --interactive/--patch"));
+ die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
exit(interactive_add(argv + 1, prefix, patch_interactive));
}
if (legacy_stash_p) {
@@ -526,7 +526,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
if (edit_interactive) {
if (pathspec_from_file)
- die(_("--pathspec-from-file is incompatible with --edit"));
+ die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--edit");
return(edit_patch(argc, argv, prefix));
}
argc--;
@@ -538,10 +538,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
addremove = 0; /* "-u" was given but not "-A" */
if (addremove && take_worktree_changes)
- die(_("-A and -u are mutually incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "-A", "-u");
if (!show_only && ignore_missing)
- die(_("Option --ignore-missing can only be used together with --dry-run"));
+ die(_("the option '%s' requires '%s'"), "--ignore-missing", "--dry-run");
if (chmod_arg && ((chmod_arg[0] != '-' && chmod_arg[0] != '+') ||
chmod_arg[1] != 'x' || chmod_arg[2]))
@@ -566,14 +566,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)
if (pathspec_from_file) {
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, PATHSPEC_ATTR,
PATHSPEC_PREFER_FULL |
PATHSPEC_SYMLINK_LEADING_PATH,
prefix, pathspec_from_file, pathspec_file_nul);
} else if (pathspec_file_nul) {
- die(_("--pathspec-file-nul requires --pathspec-from-file"));
+ die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
}
if (require_pathspec && pathspec.nr == 0) {
diff --git a/builtin/am.c b/builtin/am.c
index f2e7e53388..b6be1f1cb1 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2286,9 +2286,9 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
}
if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode)
- return error(_("--show-current-patch=%s is incompatible with "
- "--show-current-patch=%s"),
- arg, valid_modes[resume->sub_mode]);
+ return error(_("options '%s=%s' and '%s=%s' "
+ "cannot be used together"),
+ "--show-current-patch", "--show-current-patch", arg, valid_modes[resume->sub_mode]);
resume->mode = RESUME_SHOW_PATCH;
resume->sub_mode = new_value;
diff --git a/builtin/branch.c b/builtin/branch.c
index 78ce5da832..2251e6a54f 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -724,7 +724,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
finalize_colopts(&colopts, -1);
if (filter.verbose) {
if (explicitly_enable_column(colopts))
- die(_("--column and --verbose are incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "--column", "--verbose");
colopts = 0;
}
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 86fc03242b..d94050e6c1 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -729,7 +729,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
}
if (force_path && batch.enabled) {
- error("--path=<path> incompatible with --batch");
+ error("options '--path=<path>' and '--batch' cannot be used together");
usage_with_options(cat_file_usage, options);
}
diff --git a/builtin/checkout.c b/builtin/checkout.c
index bbbfabb871..94814c37b4 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -464,10 +464,10 @@ static int checkout_paths(const struct checkout_opts *opts,
die(_("'%s' cannot be used with updating paths"), "--detach");
if (opts->merge && opts->patch_mode)
- die(_("'%s' cannot be used with %s"), "--merge", "--patch");
+ die(_("options '%s' and '%s' cannot be used together"), "--merge", "--patch");
if (opts->ignore_unmerged && opts->merge)
- die(_("'%s' cannot be used with %s"),
+ die(_("options '%s' and '%s' cannot be used together"),
opts->ignore_unmerged_opt, "-m");
if (opts->new_branch)
@@ -1637,11 +1637,11 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
}
if ((!!opts->new_branch + !!opts->new_branch_force + !!opts->new_orphan_branch) > 1)
- die(_("-%c, -%c and --orphan are mutually exclusive"),
- cb_option, toupper(cb_option));
+ die(_("options '-%c', '-%c', and '%s' cannot be used together"),
+ cb_option, toupper(cb_option), "--orphan");
if (opts->overlay_mode == 1 && opts->patch_mode)
- die(_("-p and --overlay are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "-p", "--overlay");
if (opts->checkout_index >= 0 || opts->checkout_worktree >= 0) {
if (opts->checkout_index < 0)
@@ -1748,19 +1748,19 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
if (opts->pathspec_from_file) {
if (opts->pathspec.nr)
- die(_("--pathspec-from-file is incompatible with pathspec arguments"));
+ die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
if (opts->force_detach)
- die(_("--pathspec-from-file is incompatible with --detach"));
+ die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--detach");
if (opts->patch_mode)
- die(_("--pathspec-from-file is incompatible with --patch"));
+ die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
parse_pathspec_file(&opts->pathspec, 0,
0,
prefix, opts->pathspec_from_file, opts->pathspec_file_nul);
} else if (opts->pathspec_file_nul) {
- die(_("--pathspec-file-nul requires --pathspec-from-file"));
+ die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
}
opts->pathspec.recursive = 1;
diff --git a/builtin/clone.c b/builtin/clone.c
index 5bed37f8b5..13d230d299 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -900,10 +900,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_bare) {
if (option_origin)
- die(_("--bare and --origin %s options are incompatible."),
- option_origin);
+ die(_("options '%s' and '%s %s' cannot be used together"),
+ "--bare", "--origin", option_origin);
if (real_git_dir)
- die(_("--bare and --separate-git-dir are incompatible."));
+ die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir");
option_no_checkout = 1;
}
diff --git a/builtin/commit.c b/builtin/commit.c
index 883c16256c..b9ed0374e3 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -355,19 +355,19 @@ static const char *prepare_index(const char **argv, const char *prefix,
if (pathspec_from_file) {
if (interactive)
- die(_("--pathspec-from-file is incompatible with --interactive/--patch"));
+ die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
if (all)
- die(_("--pathspec-from-file with -a does not make sense"));
+ 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,
prefix, pathspec_from_file, pathspec_file_nul);
} else if (pathspec_file_nul) {
- die(_("--pathspec-file-nul requires --pathspec-from-file"));
+ die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
}
if (!pathspec.nr && (also || (only && !allow_empty &&
@@ -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)) {
@@ -1193,7 +1193,7 @@ static void finalize_deferred_config(struct wt_status *s)
status_format == STATUS_FORMAT_UNSPECIFIED)
status_format = STATUS_FORMAT_PORCELAIN;
else if (status_format == STATUS_FORMAT_LONG)
- die(_("--long and -z are incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "--long", "-z");
}
if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED)
@@ -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[],
diff --git a/builtin/describe.c b/builtin/describe.c
index e912ba50d7..42159cd26b 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -590,7 +590,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
save_commit_buffer = 0;
if (longformat && abbrev == 0)
- die(_("--long is incompatible with --abbrev=0"));
+ die(_("options '%s' and '%s' cannot be used together"), "--long", "--abbrev=0");
if (contains) {
struct string_list_item *item;
@@ -670,9 +670,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
}
describe("HEAD", 1);
} else if (dirty) {
- die(_("--dirty is incompatible with commit-ishes"));
+ die(_("option '%s' and commit-ishes cannot be used together"), "--dirty");
} else if (broken) {
- die(_("--broken is incompatible with commit-ishes"));
+ die(_("option '%s' and commit-ishes cannot be used together"), "--broken");
} else {
while (argc-- > 0)
describe(*argv++, argc == 0);
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index f33d30d57b..0e0ac1f167 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -152,7 +152,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
}
if (read_stdin && merge_base)
- die(_("--stdin and --merge-base are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--stdin", "--merge-base");
if (merge_base && opt->pending.nr != 2)
die(_("--merge-base only works with two commits"));
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 4ee40fe3a0..c79fbbf67e 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -730,10 +730,10 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
setenv(GIT_DIR_ENVIRONMENT, absolute_path(get_git_dir()), 1);
setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1);
} else if (dir_diff)
- die(_("--dir-diff is incompatible with --no-index"));
+ die(_("options '%s' and '%s' cannot be used together"), "--dir-diff", "--no-index");
if (use_gui_tool + !!difftool_cmd + !!extcmd > 1)
- die(_("--gui, --tool and --extcmd are mutually exclusive"));
+ die(_("options '%s', '%s', and '%s' cannot be used together"), "--gui", "--tool", "--extcmd");
if (use_gui_tool)
setenv("GIT_MERGETOOL_GUI", "true", 1);
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index cb1d6473f1..9f1c730e58 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -1227,7 +1227,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
usage_with_options (fast_export_usage, options);
if (anonymized_seeds.cmpfn && !anonymize)
- die(_("--anonymize-map without --anonymize does not make sense"));
+ die(_("the option '%s' requires '%s'"), "--anonymize-map", "--anonymize");
if (refspecs_list.nr) {
int i;
@@ -1242,7 +1242,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
printf("feature done\n");
if (import_filename && import_filename_if_exists)
- die(_("Cannot pass both --import-marks and --import-marks-if-exists"));
+ die(_("options '%s' and '%s' cannot be used together"), "--import-marks", "--import-marks-if-exists");
if (import_filename)
import_marks(import_filename, 0);
else if (import_filename_if_exists)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index e33fda4174..eaab8056bf 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -996,7 +996,7 @@ static int open_fetch_head(struct fetch_head *fetch_head)
if (write_fetch_head) {
fetch_head->fp = fopen(filename, "a");
if (!fetch_head->fp)
- return error_errno(_("cannot open %s"), filename);
+ return error_errno(_("cannot open '%s'"), filename);
strbuf_init(&fetch_head->buf, 0);
} else {
fetch_head->fp = NULL;
@@ -1408,7 +1408,7 @@ static int truncate_fetch_head(void)
FILE *fp = fopen_for_writing(filename);
if (!fp)
- return error_errno(_("cannot open %s"), filename);
+ return error_errno(_("cannot open '%s'"), filename);
fclose(fp);
return 0;
}
@@ -2030,12 +2030,12 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
if (deepen_relative < 0)
die(_("negative depth in --deepen is not supported"));
if (depth)
- die(_("--deepen and --depth are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--deepen", "--depth");
depth = xstrfmt("%d", deepen_relative);
}
if (unshallow) {
if (depth)
- die(_("--depth and --unshallow cannot be used together"));
+ die(_("options '%s' and '%s' cannot be used together"), "--depth", "--unshallow");
else if (!is_repository_shallow(the_repository))
die(_("--unshallow on a complete repository does not make sense"));
else
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index c23d01de7d..3c2e6aee3c 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1845,11 +1845,11 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
if (!pack_name && !from_stdin)
usage(index_pack_usage);
if (fix_thin_pack && !from_stdin)
- die(_("--fix-thin cannot be used without --stdin"));
+ die(_("the option '%s' requires '%s'"), "--fix-thin", "--stdin");
if (from_stdin && !startup_info->have_repository)
die(_("--stdin requires a git repository"));
if (from_stdin && hash_algo)
- die(_("--object-format cannot be used with --stdin"));
+ die(_("options '%s' and '%s' cannot be used together"), "--object-format", "--stdin");
if (!index_name && pack_name)
index_name = derive_filename(pack_name, "pack", "idx", &index_name_buf);
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 2167796ff2..546f9c595e 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -557,7 +557,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, init_db_options, init_db_usage, 0);
if (real_git_dir && is_bare_repository_cfg == 1)
- die(_("--separate-git-dir and --bare are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--separate-git-dir", "--bare");
if (real_git_dir && !is_absolute_path(real_git_dir))
real_git_dir = real_pathdup(real_git_dir, 1);
diff --git a/builtin/log.c b/builtin/log.c
index 942c07ece6..4b493408cc 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1943,9 +1943,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
numbered = 0;
if (numbered && keep_subject)
- die(_("-n and -k are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "-n", "-k");
if (keep_subject && subject_prefix)
- die(_("--subject-prefix/--rfc and -k are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--subject-prefix/--rfc", "-k");
rev.preserve_subject = keep_subject;
argc = setup_revisions(argc, argv, &rev, &s_r_opt);
@@ -1979,7 +1979,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
load_display_notes(&rev.notes_opt);
if (use_stdout + rev.diffopt.close_file + !!output_directory > 1)
- die(_("--stdout, --output, and --output-directory are mutually exclusive"));
+ die(_("options '%s', '%s', and '%s' cannot be used together"), "--stdout", "--output", "--output-directory");
if (use_stdout) {
setup_pager();
@@ -2112,7 +2112,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (creation_factor < 0)
creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT;
else if (!rdiff_prev)
- die(_("--creation-factor requires --range-diff"));
+ die(_("the option '%s' requires '%s'"), "--creation-factor", "--range-diff");
if (rdiff_prev) {
if (!cover_letter && total != 1)
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index c151eb1fb7..f7ea56cc63 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -775,7 +775,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
* would not make any sense with this option.
*/
if (show_stage || show_unmerged)
- die("ls-files --with-tree is incompatible with -s or -u");
+ die(_("options '%s' and '%s' cannot be used together"), "ls-files --with-tree", "-s/-u");
overlay_tree_on_index(the_repository->index, with_tree, max_prefix);
}
diff --git a/builtin/merge.c b/builtin/merge.c
index 991de01bb4..74e53cf20a 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1400,9 +1400,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
if (squash) {
if (fast_forward == FF_NO)
- die(_("You cannot combine --squash with --no-ff."));
+ die(_("options '%s' and '%s' cannot be used together"), "--squash", "--no-ff.");
if (option_commit > 0)
- die(_("You cannot combine --squash with --commit."));
+ die(_("options '%s' and '%s' cannot be used together"), "--squash", "--commit.");
/*
* squash can now silently disable option_commit - this is not
* a problem as it is only overriding the default, not a user
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index b36ed828d8..ba2006f221 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -4070,7 +4070,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
die(_("--thin cannot be used to build an indexable pack"));
if (keep_unreachable && unpack_unreachable)
- die(_("--keep-unreachable and --unpack-unreachable are incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "--unpack-unreachable");
if (!rev_list_all || !rev_list_reflog || !rev_list_index)
unpack_unreachable_expiration = 0;
diff --git a/builtin/push.c b/builtin/push.c
index 4b026ce6c6..359db90321 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -589,7 +589,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
set_push_cert_flags(&flags, push_cert);
if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
- die(_("--delete is incompatible with --all, --mirror and --tags"));
+ die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--mirror/--tags");
if (deleterefs && argc < 2)
die(_("--delete doesn't make sense without any refs"));
@@ -627,18 +627,18 @@ int cmd_push(int argc, const char **argv, const char *prefix)
if (flags & TRANSPORT_PUSH_ALL) {
if (tags)
- die(_("--all and --tags are incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "--all", "--tags");
if (argc >= 2)
die(_("--all can't be combined with refspecs"));
}
if (flags & TRANSPORT_PUSH_MIRROR) {
if (tags)
- die(_("--mirror and --tags are incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "--mirror", "--tags");
if (argc >= 2)
die(_("--mirror can't be combined with refspecs"));
}
if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR))
- die(_("--all and --mirror are incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "--all", "--mirror");
if (!is_empty_cas(&cas) && (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES))
cas.use_force_if_includes = 1;
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 34b4744e5f..36490d06c8 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1190,13 +1190,13 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (keep_base) {
if (options.onto_name)
- die(_("cannot combine '--keep-base' with '--onto'"));
+ die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--onto");
if (options.root)
- die(_("cannot combine '--keep-base' with '--root'"));
+ die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--root");
}
if (options.root && options.fork_point > 0)
- die(_("cannot combine '--root' with '--fork-point'"));
+ die(_("options '%s' and '%s' cannot be used together"), "--root", "--fork-point");
if (action != ACTION_NONE && !in_progress)
die(_("No rebase in progress?"));
@@ -1460,8 +1460,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (i >= 0) {
if (is_merge(&options))
- die(_("cannot combine apply options with "
- "merge options"));
+ die(_("apply options and merge options "
+ "cannot be used together"));
else
options.type = REBASE_APPLY;
}
diff --git a/builtin/repack.c b/builtin/repack.c
index c393a5db77..da1e364a75 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -681,7 +681,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (keep_unreachable &&
(unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE)))
- die(_("--keep-unreachable and -A are incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "-A");
if (write_bitmaps < 0) {
if (!write_midx &&
@@ -712,7 +712,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (geometric_factor) {
if (pack_everything)
- die(_("--geometric is incompatible with -A, -a"));
+ die(_("options '%s' and '%s' cannot be used together"), "--geometric", "-A/-a");
init_pack_geometry(&geometry);
split_pack_geometry(geometry, geometric_factor);
}
diff --git a/builtin/reset.c b/builtin/reset.c
index b1ff699b43..b97745ee94 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -423,16 +423,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
if (pathspec_from_file) {
if (patch_mode)
- die(_("--pathspec-from-file is incompatible with --patch"));
+ die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
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,
prefix, pathspec_from_file, pathspec_file_nul);
} else if (pathspec_file_nul) {
- die(_("--pathspec-file-nul requires --pathspec-from-file"));
+ die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
}
unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid);
@@ -459,7 +459,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
if (patch_mode) {
if (reset_type != NONE)
- die(_("--patch is incompatible with --{hard,mixed,soft}"));
+ die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}");
trace2_cmd_mode("patch-interactive");
return run_add_interactive(rev, "--patch=reset", &pathspec);
}
@@ -490,7 +490,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
_(reset_type_names[reset_type]));
if (intent_to_add && reset_type != MIXED)
- die(_("-N can only be used with --mixed"));
+ die(_("the option '%s' requires '%s'"), "-N", "--mixed");
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 36cb909eba..777558e9b0 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -538,7 +538,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
const char *arg = argv[i];
if (skip_prefix(arg, "--missing=", &arg)) {
if (revs.exclude_promisor_objects)
- die(_("cannot combine --exclude-promisor-objects and --missing"));
+ die(_("options '%s' and '%s' cannot be used together"), "--exclude-promisor-objects", "--missing");
if (parse_missing_action_value(arg))
break;
}
@@ -676,7 +676,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
if (revs.count &&
(revs.tag_objects || revs.tree_objects || revs.blob_objects) &&
(revs.left_right || revs.cherry_mark))
- die(_("marked counting is incompatible with --objects"));
+ die(_("marked counting and '%s' cannot be used together"), "--objects");
save_commit_buffer = (revs.verbose_header ||
revs.grep_filter.pattern_list ||
diff --git a/builtin/rm.c b/builtin/rm.c
index b4132e5d8e..84a935a16e 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -272,13 +272,13 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
if (pathspec_from_file) {
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_CWD,
prefix, pathspec_from_file, pathspec_file_nul);
} else if (pathspec_file_nul) {
- die(_("--pathspec-file-nul requires --pathspec-from-file"));
+ die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
}
if (!pathspec.nr)
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index f1e8318592..e12c5e80e3 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -707,8 +707,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
*
* Also --all and --remotes do not make sense either.
*/
- die(_("--reflog is incompatible with --all, --remotes, "
- "--independent or --merge-base"));
+ die(_("options '%s' and '%s' cannot be used together"), "--reflog",
+ "--all/--remotes/--independent/--merge-base");
}
/* If nothing is specified, show all branches by default */
diff --git a/builtin/stash.c b/builtin/stash.c
index 6da736d718..6b4eb5c258 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1703,19 +1703,19 @@ static int push_stash(int argc, const char **argv, const char *prefix,
if (pathspec_from_file) {
if (patch_mode)
- die(_("--pathspec-from-file is incompatible with --patch"));
+ die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
if (only_staged)
- die(_("--pathspec-from-file is incompatible with --staged"));
+ die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--staged");
if (ps.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(&ps, 0,
PATHSPEC_PREFER_FULL | PATHSPEC_PREFIX_ORIGIN,
prefix, pathspec_from_file, pathspec_file_nul);
} else if (pathspec_file_nul) {
- die(_("--pathspec-file-nul requires --pathspec-from-file"));
+ die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
}
return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 9b25a508e6..c5d3fc3817 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1313,7 +1313,7 @@ static int module_summary(int argc, const char **argv, const char *prefix)
if (files) {
if (cached)
- die(_("--cached and --files are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--cached", "--files");
diff_cmd = DIFF_FILES;
}
@@ -2972,7 +2972,7 @@ static int module_set_branch(int argc, const char **argv, const char *prefix)
die(_("--branch or --default required"));
if (opt_branch && opt_default)
- die(_("--branch and --default are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--branch", "--default");
if (argc != 1 || !(path = argv[0]))
usage_with_options(usage, options);
diff --git a/builtin/tag.c b/builtin/tag.c
index 41863c5ab7..134b3f1edf 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -483,6 +483,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
OPT_END()
};
int ret = 0;
+ const char *only_in_list = NULL;
setup_ref_filter_porcelain_msg();
@@ -522,7 +523,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
finalize_colopts(&colopts, -1);
if (cmdmode == 'l' && filter.lines != -1) {
if (explicitly_enable_column(colopts))
- die(_("--column and -n are incompatible"));
+ die(_("options '%s' and '%s' cannot be used together"), "--column", "-n");
colopts = 0;
}
sorting = ref_sorting_options(&sorting_options);
@@ -542,15 +543,19 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
goto cleanup;
}
if (filter.lines != -1)
- die(_("-n option is only allowed in list mode"));
- if (filter.with_commit)
- die(_("--contains option is only allowed in list mode"));
- if (filter.no_commit)
- die(_("--no-contains option is only allowed in list mode"));
- if (filter.points_at.nr)
- die(_("--points-at option is only allowed in list mode"));
- if (filter.reachable_from || filter.unreachable_from)
- die(_("--merged and --no-merged options are only allowed in list mode"));
+ only_in_list = "-n";
+ else if (filter.with_commit)
+ only_in_list = "--contains";
+ else if (filter.no_commit)
+ only_in_list = "--no-contains";
+ else if (filter.points_at.nr)
+ only_in_list = "--points-at";
+ else if (filter.reachable_from)
+ only_in_list = "--merged";
+ else if (filter.unreachable_from)
+ only_in_list = "--no-merged";
+ if (only_in_list)
+ die(_("the '%s' option is only allowed in list mode"), only_in_list);
if (cmdmode == 'd') {
ret = delete_tags(argv);
goto cleanup;
@@ -564,7 +569,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
if (msg.given || msgfile) {
if (msg.given && msgfile)
- die(_("only one -F or -m option is allowed."));
+ die(_("options '%s' and '%s' cannot be used together"), "-F", "-m");
if (msg.given)
strbuf_addbuf(&buf, &(msg.buf));
else {
diff --git a/builtin/worktree.c b/builtin/worktree.c
index a396cfdc64..2838254f7f 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -503,9 +503,9 @@ static int add(int ac, const char **av, const char *prefix)
opts.checkout = 1;
ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
if (!!opts.detach + !!new_branch + !!new_branch_force > 1)
- die(_("-b, -B, and --detach are mutually exclusive"));
+ die(_("options '%s', '%s', and '%s' cannot be used together"), "-b", "-B", "--detach");
if (lock_reason && !keep_locked)
- die(_("--reason requires --lock"));
+ die(_("the option '%s' requires '%s'"), "--reason", "--lock");
if (lock_reason)
opts.keep_locked = lock_reason;
else if (keep_locked)
@@ -699,7 +699,7 @@ static int list(int ac, const char **av, const char *prefix)
if (ac)
usage_with_options(worktree_usage, options);
else if (verbose && porcelain)
- die(_("--verbose and --porcelain are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--verbose", "--porcelain");
else {
struct worktree **worktrees = get_worktrees();
int path_maxlen = 0, abbrev = DEFAULT_ABBREV, i;