git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Jeff King" <peff@peff.net>, "Johannes Sixt" <j6t@kdbg.org>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Jean-Noël Avila" <jn.avila@free.fr>,
	"Jean-Noël Avila" <jn.avila@free.fr>
Subject: [PATCH v3 01/11] i18n: refactor "foo and bar are mutually exclusive"
Date: Wed, 29 Dec 2021 18:54:57 +0000	[thread overview]
Message-ID: <05af90f5814de9c066bbafdaea7a6475ae1125c1.1640804107.git.gitgitgadget@gmail.com> (raw)
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 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>
---
 builtin/checkout.c             | 2 +-
 builtin/diff-tree.c            | 2 +-
 builtin/fetch.c                | 4 ++--
 builtin/init-db.c              | 2 +-
 builtin/log.c                  | 4 ++--
 builtin/submodule--helper.c    | 4 ++--
 builtin/worktree.c             | 2 +-
 range-diff.c                   | 2 +-
 t/t0001-init.sh                | 2 +-
 t/t2025-checkout-no-overlay.sh | 2 +-
 10 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 72beeb49aa9..79014e1cb6c 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -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)
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index f33d30d57bf..0e0ac1f1670 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -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"));
 
diff --git a/builtin/fetch.c b/builtin/fetch.c
index f1fe73a3e0f..2c584c85812 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -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
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 2167796ff2a..546f9c595e7 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -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);
diff --git a/builtin/log.c b/builtin/log.c
index 93ace0dde7d..fad93ad2fc1 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -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);
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 9b25a508e6a..c5d3fc3817f 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -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);
diff --git a/builtin/worktree.c b/builtin/worktree.c
index a396cfdc64e..9a520485769 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -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;
diff --git a/range-diff.c b/range-diff.c
index cac89a2f4f2..30a4de5c2d8 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -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);
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 7603ad2f82b..3235ab4d53c 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -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' '
diff --git a/t/t2025-checkout-no-overlay.sh b/t/t2025-checkout-no-overlay.sh
index fa9e0987063..8f13341cf8e 100755
--- a/t/t2025-checkout-no-overlay.sh
+++ b/t/t2025-checkout-no-overlay.sh
@@ -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' '
-- 
gitgitgadget


  reply	other threads:[~2021-12-29 18:55 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  7:01 [PATCH 00/10] Factorization of messages with similar meaning Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 01/10] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2021-12-07 18:07   ` Ævar Arnfjörð Bjarmason
2021-12-08 18:13     ` Jean-Noël AVILA
2021-12-03  7:01 ` [PATCH 02/10] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 03/10] i18n: turn "options are incompatible" into "are " Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 04/10] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2021-12-07 18:09   ` Ævar Arnfjörð Bjarmason
2021-12-03  7:01 ` [PATCH 05/10] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2021-12-07 18:10   ` Ævar Arnfjörð Bjarmason
2021-12-03  7:01 ` [PATCH 06/10] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 07/10] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 08/10] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2021-12-07 18:15   ` Ævar Arnfjörð Bjarmason
2021-12-03  7:01 ` [PATCH 09/10] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2021-12-03  7:01 ` [PATCH 10/10] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2021-12-03 21:55 ` [PATCH 00/10] Factorization of messages with similar meaning Jeff King
2021-12-03 23:39   ` Johannes Sixt
2021-12-05  7:31     ` Junio C Hamano
2021-12-05 17:25       ` Jean-Noël AVILA
2021-12-05 19:50         ` Johannes Sixt
2021-12-06 19:18           ` Junio C Hamano
2021-12-05 19:30 ` Junio C Hamano
2021-12-27 23:23 ` [PATCH v2 00/11] " Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 01/11] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 02/11] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 03/11] i18n: turn "options are incompatible" into "cannot be used together" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 04/11] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 05/11] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2021-12-27 23:42     ` Junio C Hamano
2021-12-27 23:45       ` Ævar Arnfjörð Bjarmason
2021-12-28  0:16         ` Junio C Hamano
2021-12-29 14:05           ` Jean-Noël AVILA
2021-12-27 23:23   ` [PATCH v2 06/11] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2021-12-28  7:01     ` Johannes Sixt
2021-12-29 14:02       ` Jean-Noël AVILA
2021-12-27 23:23   ` [PATCH v2 07/11] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 08/11] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 09/11] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2021-12-27 23:23   ` [PATCH v2 11/11] i18n: turn even more messages into "cannot be used together" ones Jean-Noël Avila via GitGitGadget
2021-12-28  7:33     ` Johannes Sixt
2021-12-29 15:49       ` Jean-Noël AVILA
2021-12-29 18:54   ` [PATCH v3 00/11] Factorization of messages with similar meaning Jean-Noël Avila via GitGitGadget
2021-12-29 18:54     ` Jean-Noël Avila via GitGitGadget [this message]
2021-12-29 18:54     ` [PATCH v3 02/11] i18n: refactor "%s, %s and %s are mutually exclusive" Jean-Noël Avila via GitGitGadget
2021-12-30 22:26       ` Junio C Hamano
2021-12-31 17:05         ` Jean-Noël AVILA
2021-12-29 18:54     ` [PATCH v3 03/11] i18n: turn "options are incompatible" into "cannot be used together" Jean-Noël Avila via GitGitGadget
2021-12-29 19:36       ` Johannes Sixt
2021-12-30 16:52         ` Jean-Noël AVILA
2021-12-30 22:36           ` Junio C Hamano
2021-12-29 18:55     ` [PATCH v3 04/11] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 05/11] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2022-01-01 14:14       ` René Scharfe
2021-12-29 18:55     ` [PATCH v3 06/11] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 07/11] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2021-12-30 22:36       ` Junio C Hamano
2021-12-29 18:55     ` [PATCH v3 08/11] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 09/11] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2021-12-29 18:55     ` [PATCH v3 11/11] i18n: turn even more messages into "cannot be used together" ones Jean-Noël Avila via GitGitGadget
2021-12-30 22:36       ` Junio C Hamano
2021-12-31 17:16         ` Jean-Noël AVILA
2022-01-03 21:51           ` Junio C Hamano
2022-01-02 17:15     ` [PATCH v4 00/11] Factorization of messages with similar meaning Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 01/11] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 02/11] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2022-01-03 15:44         ` Johannes Sixt
2022-01-02 17:15       ` [PATCH v4 03/11] i18n: turn "options are incompatible" into "cannot be used together" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 04/11] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 05/11] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2022-01-02 17:37         ` René Scharfe
2022-01-02 20:29           ` Jean-Noël AVILA
2022-01-02 17:15       ` [PATCH v4 06/11] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 07/11] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 08/11] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 09/11] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2022-01-02 17:15       ` [PATCH v4 11/11] i18n: turn even more messages into "cannot be used together" ones Jean-Noël Avila via GitGitGadget
2022-01-05 20:02       ` [PATCH v5 00/11] Factorization of messages with similar meaning Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 01/11] i18n: refactor "foo and bar are mutually exclusive" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 02/11] i18n: refactor "%s, %s and %s " Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 03/11] i18n: turn "options are incompatible" into "cannot be used together" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 04/11] i18n: standardize "cannot open" and "cannot read" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 05/11] i18n: tag.c factorize i18n strings Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 06/11] i18n: factorize "--foo requires --bar" and the like Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 07/11] i18n: factorize "no directory given for --foo" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 08/11] i18n: refactor "unrecognized %(foo) argument" strings Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 09/11] i18n: factorize "--foo outside a repository" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" Jean-Noël Avila via GitGitGadget
2022-01-05 20:02         ` [PATCH v5 11/11] i18n: turn even more messages into "cannot be used together" ones Jean-Noël Avila via GitGitGadget
2022-01-05 20:58         ` [PATCH v5 00/11] Factorization of messages with similar meaning Johannes Sixt
2022-01-05 21:31           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05af90f5814de9c066bbafdaea7a6475ae1125c1.1640804107.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=jn.avila@free.fr \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).