]> git.ipfire.org Git - thirdparty/git.git/commitdiff
i18n: refactor "foo and bar are mutually exclusive"
authorJean-Noël Avila <jn.avila@free.fr>
Wed, 5 Jan 2022 20:02:14 +0000 (20:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Jan 2022 21:29:23 +0000 (13:29 -0800)
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>
builtin/checkout.c
builtin/diff-tree.c
builtin/fetch.c
builtin/init-db.c
builtin/log.c
builtin/submodule--helper.c
builtin/worktree.c
range-diff.c
t/t0001-init.sh
t/t2025-checkout-no-overlay.sh

index 72beeb49aa90c290724cfcdfe905d67ce3224f89..79014e1cb6c949cc3b0231454e4f85c9566838ff 100644 (file)
@@ -1639,7 +1639,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
                                cb_option, toupper(cb_option));
 
        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)
index f33d30d57bff2ef8923ea9649a5afd4d49eb0574..0e0ac1f1670f3b21f01c4fbbc602c53392331a9c 100644 (file)
@@ -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"));
 
index f1fe73a3e0f1d77e275bdd463b404a9935566b63..2c584c85812a54b43d950c61a46fd91b0d30df96 100644 (file)
@@ -2028,12 +2028,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
index 2167796ff2aad00762c2011b399305c94daa2a40..546f9c595e7d8c04127d3d1a3216be4673d7e6c9 100644 (file)
@@ -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);
index 93ace0dde7d0db29a62602a2115c7a4b63327473..fad93ad2fc13302945c35104a3c08d146d1473a7 100644 (file)
@@ -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);
index 9b25a508e6a7bb6116b48b36ab4b15e8f670552b..c5d3fc3817f5990fec156496839ec29686e4b9e6 100644 (file)
@@ -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);
index a396cfdc64e4a48f0f56ef2db6a359de43c3017a..9a5204857695bd608e12b5010114abc2ea664f66 100644 (file)
@@ -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;
index cac89a2f4f2c8d4c6471f0a55bc725cf17a2d9b9..30a4de5c2d8a1447dc23d6b5d61278df0f796bbb 100644 (file)
@@ -556,7 +556,7 @@ int show_range_diff(const char *range1, const char *range2,
        struct string_list branch2 = STRING_LIST_INIT_DUP;
 
        if (range_diff_opts->left_only && range_diff_opts->right_only)
-               res = error(_("--left-only and --right-only are mutually exclusive"));
+               res = error(_("options '%s' and '%s' cannot be used together"), "--left-only", "--right-only");
 
        if (!res && read_patches(range1, &branch1, range_diff_opts->other_arg))
                res = error(_("could not parse log for '%s'"), range1);
index 7603ad2f82b28264ce19ae77d6bbc250fb9a94fa..3235ab4d53c9dfc282155f1da2caa44d7f40962c 100755 (executable)
@@ -331,7 +331,7 @@ test_expect_success 'init with separate gitdir' '
 
 test_expect_success 'explicit bare & --separate-git-dir incompatible' '
        test_must_fail git init --bare --separate-git-dir goop.git bare.git 2>err &&
-       test_i18ngrep "mutually exclusive" err
+       test_i18ngrep "cannot be used together" err
 '
 
 test_expect_success 'implicit bare & --separate-git-dir incompatible' '
index fa9e0987063bd409592f45b5f71f67478a2f9f25..8f13341cf8ee0d82e0adeeb28449e31d104a5243 100755 (executable)
@@ -25,7 +25,7 @@ test_expect_success 'checkout --no-overlay removing last file from directory' '
 
 test_expect_success 'checkout -p --overlay is disallowed' '
        test_must_fail git checkout -p --overlay HEAD 2>actual &&
-       test_i18ngrep "fatal: -p and --overlay are mutually exclusive" actual
+       test_i18ngrep "fatal: options .-p. and .--overlay. cannot be used together" actual
 '
 
 test_expect_success '--no-overlay --theirs with D/F conflict deletes file' '