i18n: refactor "foo and bar are mutually exclusive"
Use static strings for constant parts of the sentences. They are all turned into "cannot be used together". 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>
Jean-Noël Avila committed
Jan 5, 2022 at 20:02 UTC
43ea635c35371b22a7a2010398d47040c5b95adc
10 files changed
+13
-13
builtin/checkout.c
+1
-1
@@ -1639,7 +1639,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
1639
cb_option, toupper(cb_option));
1640
1641
if (opts->overlay_mode == 1 && opts->patch_mode)
1642
- die(_("-p and --overlay are mutually exclusive"));
1642
+ die(_("options '%s' and '%s' cannot be used together"), "-p", "--overlay");
1643
1644
if (opts->checkout_index >= 0 || opts->checkout_worktree >= 0) {
1645
if (opts->checkout_index < 0)
builtin/diff-tree.c
+1
-1
@@ -152,7 +152,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
152
}
153
154
if (read_stdin && merge_base)
155
- die(_("--stdin and --merge-base are mutually exclusive"));
155
+ die(_("options '%s' and '%s' cannot be used together"), "--stdin", "--merge-base");
156
if (merge_base && opt->pending.nr != 2)
157
die(_("--merge-base only works with two commits"));
158
builtin/fetch.c
+2
-2
@@ -2028,12 +2028,12 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
2028
if (deepen_relative < 0)
2029
die(_("negative depth in --deepen is not supported"));
2030
if (depth)
2031
- die(_("--deepen and --depth are mutually exclusive"));
2031
+ die(_("options '%s' and '%s' cannot be used together"), "--deepen", "--depth");
2032
depth = xstrfmt("%d", deepen_relative);
2033
}
2034
if (unshallow) {
2035
if (depth)
2036
- die(_("--depth and --unshallow cannot be used together"));
2036
+ die(_("options '%s' and '%s' cannot be used together"), "--depth", "--unshallow");
2037
else if (!is_repository_shallow(the_repository))
2038
die(_("--unshallow on a complete repository does not make sense"));
2039
else
builtin/init-db.c
+1
-1
@@ -557,7 +557,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
557
argc = parse_options(argc, argv, prefix, init_db_options, init_db_usage, 0);
558
559
if (real_git_dir && is_bare_repository_cfg == 1)
560
- die(_("--separate-git-dir and --bare are mutually exclusive"));
560
+ die(_("options '%s' and '%s' cannot be used together"), "--separate-git-dir", "--bare");
561
562
if (real_git_dir && !is_absolute_path(real_git_dir))
563
real_git_dir = real_pathdup(real_git_dir, 1);
builtin/log.c
+2
-2
@@ -1943,9 +1943,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1943
numbered = 0;
1944
1945
if (numbered && keep_subject)
1946
- die(_("-n and -k are mutually exclusive"));
1946
+ die(_("options '%s' and '%s' cannot be used together"), "-n", "-k");
1947
if (keep_subject && subject_prefix)
1948
- die(_("--subject-prefix/--rfc and -k are mutually exclusive"));
1948
+ die(_("options '%s' and '%s' cannot be used together"), "--subject-prefix/--rfc", "-k");
1949
rev.preserve_subject = keep_subject;
1950
1951
argc = setup_revisions(argc, argv, &rev, &s_r_opt);
builtin/submodule--helper.c
+2
-2
@@ -1313,7 +1313,7 @@ static int module_summary(int argc, const char **argv, const char *prefix)
1313
1314
if (files) {
1315
if (cached)
1316
- die(_("--cached and --files are mutually exclusive"));
1316
+ die(_("options '%s' and '%s' cannot be used together"), "--cached", "--files");
1317
diff_cmd = DIFF_FILES;
1318
}
1319
@@ -2972,7 +2972,7 @@ static int module_set_branch(int argc, const char **argv, const char *prefix)
2972
die(_("--branch or --default required"));
2973
2974
if (opt_branch && opt_default)
2975
- die(_("--branch and --default are mutually exclusive"));
2975
+ die(_("options '%s' and '%s' cannot be used together"), "--branch", "--default");
2976
2977
if (argc != 1 || !(path = argv[0]))
2978
usage_with_options(usage, options);
builtin/worktree.c
+1
-1
@@ -699,7 +699,7 @@ static int list(int ac, const char **av, const char *prefix)
699
if (ac)
700
usage_with_options(worktree_usage, options);
701
else if (verbose && porcelain)
702
- die(_("--verbose and --porcelain are mutually exclusive"));
702
+ die(_("options '%s' and '%s' cannot be used together"), "--verbose", "--porcelain");
703
else {
704
struct worktree **worktrees = get_worktrees();
705
int path_maxlen = 0, abbrev = DEFAULT_ABBREV, i;
range-diff.c
+1
-1
@@ -556,7 +556,7 @@ int show_range_diff(const char *range1, const char *range2,
556
struct string_list branch2 = STRING_LIST_INIT_DUP;
557
558
if (range_diff_opts->left_only && range_diff_opts->right_only)
559
- res = error(_("--left-only and --right-only are mutually exclusive"));
559
+ res = error(_("options '%s' and '%s' cannot be used together"), "--left-only", "--right-only");
560
561
if (!res && read_patches(range1, &branch1, range_diff_opts->other_arg))
562
res = error(_("could not parse log for '%s'"), range1);
t/t0001-init.sh
+1
-1
@@ -331,7 +331,7 @@ test_expect_success 'init with separate gitdir' '
331
332
test_expect_success 'explicit bare & --separate-git-dir incompatible' '
333
test_must_fail git init --bare --separate-git-dir goop.git bare.git 2>err &&
334
- test_i18ngrep "mutually exclusive" err
334
+ test_i18ngrep "cannot be used together" err
335
'
336
337
test_expect_success 'implicit bare & --separate-git-dir incompatible' '
t/t2025-checkout-no-overlay.sh
+1
-1
@@ -25,7 +25,7 @@ test_expect_success 'checkout --no-overlay removing last file from directory' '
25
26
test_expect_success 'checkout -p --overlay is disallowed' '
27
test_must_fail git checkout -p --overlay HEAD 2>actual &&
28
- test_i18ngrep "fatal: -p and --overlay are mutually exclusive" actual
28
+ test_i18ngrep "fatal: options .-p. and .--overlay. cannot be used together" actual
29
'
30
31
test_expect_success '--no-overlay --theirs with D/F conflict deletes file' '