]> git.ipfire.org Git - thirdparty/git.git/commitdiff
i18n: refactor "%s, %s and %s are mutually exclusive"
authorJean-Noël Avila <jn.avila@free.fr>
Wed, 5 Jan 2022 20:02:15 +0000 (20:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Jan 2022 21:29:23 +0000 (13:29 -0800)
Use placeholders for constant tokens. The strings are 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/difftool.c
builtin/log.c
builtin/worktree.c
diff.c
t/t4209-log-pickaxe.sh

index 4ee40fe3a0698d2cb1468c81f56062de49a82d5e..5beadc07ccd7eb215214dcff150f87cddf926e6e 100644 (file)
@@ -733,7 +733,7 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
                die(_("--dir-diff is incompatible with --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);
index fad93ad2fc13302945c35104a3c08d146d1473a7..74b41db1ceef85569668931044ca1d9cd60fdeaa 100644 (file)
@@ -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();
index 9a5204857695bd608e12b5010114abc2ea664f66..ec1c59ba53cd62cafee3688ff2fa6f14bcc78f0f 100644 (file)
@@ -503,7 +503,7 @@ 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"));
        if (lock_reason)
diff --git a/diff.c b/diff.c
index 410768574280f1179c78724ae13387f351cbf4cd..02ce779e43ad50078b2cad1415cb1f2984e61db7 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -4642,7 +4642,7 @@ void diff_setup_done(struct diff_options *options)
                die(_("--name-only, --name-status, --check and -s are mutually exclusive"));
 
        if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK))
-               die(_("-G, -S and --find-object are mutually exclusive"));
+               die(_("options '%s', '%s', and '%s' cannot be used together"), "-G", "-S", "--find-object");
 
        if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK))
                die(_("-G and --pickaxe-regex are mutually exclusive, use --pickaxe-regex with -S"));
index 75795d0b492b4b3a32ab0539a1932bd9c38fcd6c..4f820f8597d63abef1e9b4621f80fc753ecadf68 100755 (executable)
@@ -63,13 +63,13 @@ test_expect_success 'usage' '
        test_i18ngrep "switch.*requires a value" err &&
 
        test_expect_code 128 git log -Gregex -Sstring 2>err &&
-       grep "mutually exclusive" err &&
+       grep "cannot be used together" err &&
 
        test_expect_code 128 git log -Gregex --find-object=HEAD 2>err &&
-       grep "mutually exclusive" err &&
+       grep "cannot be used together" err &&
 
        test_expect_code 128 git log -Sstring --find-object=HEAD 2>err &&
-       grep "mutually exclusive" err &&
+       grep "cannot be used together" err &&
 
        test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err &&
        grep "mutually exclusive" err