i18n: refactor "%s, %s and %s are mutually exclusive"

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>

Jean-Noël Avila committed Jan 5, 2022 at 20:02 UTC c488182903d97da70b7a486e514ab871345067cc
5 files changed +7 -7
builtin/difftool.c
+1 -1
@@ -733,7 +733,7 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
733 die(_("--dir-diff is incompatible with --no-index"));
734
735 if (use_gui_tool + !!difftool_cmd + !!extcmd > 1)
736 - die(_("--gui, --tool and --extcmd are mutually exclusive"));
736 + die(_("options '%s', '%s', and '%s' cannot be used together"), "--gui", "--tool", "--extcmd");
737
738 if (use_gui_tool)
739 setenv("GIT_MERGETOOL_GUI", "true", 1);
builtin/log.c
+1 -1
@@ -1979,7 +1979,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1979 load_display_notes(&rev.notes_opt);
1980
1981 if (use_stdout + rev.diffopt.close_file + !!output_directory > 1)
1982 - die(_("--stdout, --output, and --output-directory are mutually exclusive"));
1982 + die(_("options '%s', '%s', and '%s' cannot be used together"), "--stdout", "--output", "--output-directory");
1983
1984 if (use_stdout) {
1985 setup_pager();
builtin/worktree.c
+1 -1
@@ -503,7 +503,7 @@ static int add(int ac, const char **av, const char *prefix)
503 opts.checkout = 1;
504 ac = parse_options(ac, av, prefix, options, worktree_usage, 0);
505 if (!!opts.detach + !!new_branch + !!new_branch_force > 1)
506 - die(_("-b, -B, and --detach are mutually exclusive"));
506 + die(_("options '%s', '%s', and '%s' cannot be used together"), "-b", "-B", "--detach");
507 if (lock_reason && !keep_locked)
508 die(_("--reason requires --lock"));
509 if (lock_reason)
diff.c
+1 -1
@@ -4642,7 +4642,7 @@ void diff_setup_done(struct diff_options *options)
4642 die(_("--name-only, --name-status, --check and -s are mutually exclusive"));
4643
4644 if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK))
4645 - die(_("-G, -S and --find-object are mutually exclusive"));
4645 + die(_("options '%s', '%s', and '%s' cannot be used together"), "-G", "-S", "--find-object");
4646
4647 if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK))
4648 die(_("-G and --pickaxe-regex are mutually exclusive, use --pickaxe-regex with -S"));
t/t4209-log-pickaxe.sh
+3 -3
@@ -63,13 +63,13 @@ test_expect_success 'usage' '
63 test_i18ngrep "switch.*requires a value" err &&
64
65 test_expect_code 128 git log -Gregex -Sstring 2>err &&
66 - grep "mutually exclusive" err &&
66 + grep "cannot be used together" err &&
67
68 test_expect_code 128 git log -Gregex --find-object=HEAD 2>err &&
69 - grep "mutually exclusive" err &&
69 + grep "cannot be used together" err &&
70
71 test_expect_code 128 git log -Sstring --find-object=HEAD 2>err &&
72 - grep "mutually exclusive" err &&
72 + grep "cannot be used together" err &&
73
74 test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err &&
75 grep "mutually exclusive" err