git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 02/11] i18n: refactor "%s, %s and %s are mutually exclusive"

From
Jean-Noël Avila via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 29, 2021, 18:54 UTC
Message-ID
<4accf1629e55ae621053f27994ebc4eb59d6f0ff.1640804107.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1088.v3.git.1640804107.gitgitgadget@gmail.com>
From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

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>
---
 builtin/difftool.c     | 2 +-
 builtin/log.c          | 2 +-
 builtin/worktree.c     | 2 +-
 diff.c                 | 2 +-
 t/t4209-log-pickaxe.sh | 6 +++---
 5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 4ee40fe3a06..c2b049aafc9 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -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);
diff --git a/builtin/log.c b/builtin/log.c
index fad93ad2fc1..705d58110b0 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -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();
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 9a520485769..b5ef19b2dda 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -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 41076857428..8de1c49763c 100644
--- 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"));
diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh
index 75795d0b492..4f820f8597d 100755
--- a/t/t4209-log-pickaxe.sh
+++ b/t/t4209-log-pickaxe.sh
@@ -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
-- 
gitgitgadget
Previous: Jean-Noël Avila via GitGitGadgetNext: Junio C Hamano
Message 46 of 94 in “Factorization of messages with similar meaning”
  1. 00/10 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Dec 3, 2021
  2. 02/10 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  3. 04/10 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  4. Ævar Arnfjörð BjarmasonDec 7, 2021
  5. 01/10 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  6. Ævar Arnfjörð BjarmasonDec 7, 2021
  7. Jean-Noël AVILADec 8, 2021
  8. 05/10 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Dec 3, 2021
  9. Ævar Arnfjörð BjarmasonDec 7, 2021
  10. 03/10 i18n: turn "options are incompatible" into "are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  11. 06/10 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Dec 3, 2021
  12. 08/10 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Dec 3, 2021
  13. Ævar Arnfjörð BjarmasonDec 7, 2021
  14. 07/10 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  15. 09/10 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  16. 10/10 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  17. Jeff KingDec 3, 2021
  18. Johannes SixtDec 3, 2021
  19. Junio C HamanoDec 5, 2021
  20. Jean-Noël AVILADec 5, 2021
  21. Johannes SixtDec 5, 2021
  22. Junio C HamanoDec 6, 2021
  23. Junio C HamanoDec 5, 2021
  24. 00/11 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Dec 27, 2021
  25. 01/11 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  26. 02/11 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  27. 05/11 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Dec 27, 2021
  28. Junio C HamanoDec 27, 2021
  29. Ævar Arnfjörð BjarmasonDec 27, 2021
  30. Junio C HamanoDec 28, 2021
  31. Jean-Noël AVILADec 29, 2021
  32. 06/11 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Dec 27, 2021
  33. Johannes SixtDec 28, 2021
  34. Jean-Noël AVILADec 29, 2021
  35. 07/11 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  36. 04/11 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  37. 03/11 i18n: turn "options are incompatible" into "cannot be used together"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  38. 10/11 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  39. 09/11 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  40. 08/11 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Dec 27, 2021
  41. 11/11 i18n: turn even more messages into "cannot be used together" onesJean-Noël Avila via GitGitGadget, Dec 27, 2021
  42. Johannes SixtDec 28, 2021
  43. Jean-Noël AVILADec 29, 2021
  44. 00/11 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Dec 29, 2021
  45. 01/11 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  46. 02/11 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  47. Junio C HamanoDec 30, 2021
  48. Jean-Noël AVILADec 31, 2021
  49. 03/11 i18n: turn "options are incompatible" into "cannot be used together"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  50. Johannes SixtDec 29, 2021
  51. Jean-Noël AVILADec 30, 2021
  52. Junio C HamanoDec 30, 2021
  53. 04/11 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  54. 05/11 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Dec 29, 2021
  55. René ScharfeJan 1, 2022
  56. 08/11 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Dec 29, 2021
  57. 07/11 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  58. Junio C HamanoDec 30, 2021
  59. 11/11 i18n: turn even more messages into "cannot be used together" onesJean-Noël Avila via GitGitGadget, Dec 29, 2021
  60. Junio C HamanoDec 30, 2021
  61. Jean-Noël AVILADec 31, 2021
  62. Junio C HamanoJan 3, 2022
  63. 10/11 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  64. 09/11 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  65. 06/11 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Dec 29, 2021
  66. 00/11 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Jan 2, 2022
  67. 01/11 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  68. 02/11 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  69. Johannes SixtJan 3, 2022
  70. 03/11 i18n: turn "options are incompatible" into "cannot be used together"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  71. 04/11 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  72. 05/11 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Jan 2, 2022
  73. René ScharfeJan 2, 2022
  74. Jean-Noël AVILAJan 2, 2022
  75. 08/11 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Jan 2, 2022
  76. 07/11 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  77. 06/11 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Jan 2, 2022
  78. 09/11 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  79. 10/11 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  80. 11/11 i18n: turn even more messages into "cannot be used together" onesJean-Noël Avila via GitGitGadget, Jan 2, 2022
  81. 00/11 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Jan 5, 2022
  82. 01/11 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  83. 02/11 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  84. 04/11 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  85. 03/11 i18n: turn "options are incompatible" into "cannot be used together"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  86. 05/11 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Jan 5, 2022
  87. 07/11 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  88. 06/11 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Jan 5, 2022
  89. 08/11 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Jan 5, 2022
  90. 11/11 i18n: turn even more messages into "cannot be used together" onesJean-Noël Avila via GitGitGadget, Jan 5, 2022
  91. 09/11 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  92. 10/11 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  93. Johannes SixtJan 5, 2022
  94. Junio C HamanoJan 5, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.