From patchwork Wed Jan 5 20:02:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 516CAC433F5 for ; Wed, 5 Jan 2022 20:02:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243805AbiAEUCc (ORCPT ); Wed, 5 Jan 2022 15:02:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243796AbiAEUC2 (ORCPT ); Wed, 5 Jan 2022 15:02:28 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF32C061201 for ; Wed, 5 Jan 2022 12:02:28 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id o3so421988wrh.10 for ; Wed, 05 Jan 2022 12:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=oDSv+jfkES/5aeO4nlyTi+OEPCC3LcnBSenC4Md1paM=; b=Wobu4fkW6G1dI0+wn48zFV2UFZZ02n5ymxIiYwSW3/iuHmFV1b0h2e+D4FD4eXQ+WN dMBFiFLKFUeeXq7RzVINCtz/cWrlEsLOGI46cKxTxjebIa/300pNJjMLy9NRcT0rMEva lLWr1tXffFEErsRmFKDs5ygx5x/Rg1ojc3GdFzJ+A1CwSH17XP0MmqYglsIAhIFod2gX aXOsOWd3e4SmCOPaHTQKhWQdKYmuS90iyR9QIX9JByZKFV1ccMx8ve6HLgEC976kPh1w EDMfUbheRB0/xn12T1x/6jHJsMCS1ySxcmlBMdayHPuyKkap1kpCPtKIJfSPqRgSraum xdXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=oDSv+jfkES/5aeO4nlyTi+OEPCC3LcnBSenC4Md1paM=; b=skB6GJwAbKIZVnawYz/BX/tgAVqe+RsjL3utoK/jmvNxzsZWAeZwdK46/Ri9a4Q1Cf cKwMscTfIXz9AjYzt1ggem2QlRgJs162zUzPCTdAoIfZjzNG5Bw6ulw1FHm8mcekPl/e gTYMVvb6GXonfx+GkmoFocbiK1BrzF+xX1OuQMcl3yscSEkIgc8do6EDy6eU5hhCTWmJ d1jyyYVRbqKhzOt+WzUcKn8vuWkZg35vIH2Y/LgxnWqseWxRsdFSavrl+1YITUptxLec odTtPuaGIGxdDaOa4RZTEREyIla9jzA3kZtn5vY9MJwUjh0kyw4fvxhlUd29R0iMzBSI B43Q== X-Gm-Message-State: AOAM5336fS3pYRnP2vCry/nnrNwFxDlloju6b4gWIXXNckbxU18CcDRb O7IvP0VA/2m0SkpbYfYNQsY3uWrlggI= X-Google-Smtp-Source: ABdhPJxT6kvEjy72FIDF8SIHwWQrr+PrfW1zFU8HMNaKCeomnYdTrI8oxyFsikswzWgcgF25QG8X4A== X-Received: by 2002:adf:eccd:: with SMTP id s13mr48926631wro.618.1641412946818; Wed, 05 Jan 2022 12:02:26 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r1sm47894780wrz.30.2022.01.05.12.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:26 -0800 (PST) Message-Id: <05af90f5814de9c066bbafdaea7a6475ae1125c1.1641412944.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:14 +0000 Subject: [PATCH v5 01/11] i18n: refactor "foo and bar are mutually exclusive" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= 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 --- 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' ' From patchwork Wed Jan 5 20:02:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E0FAC4332F for ; Wed, 5 Jan 2022 20:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243820AbiAEUCg (ORCPT ); Wed, 5 Jan 2022 15:02:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243797AbiAEUC3 (ORCPT ); Wed, 5 Jan 2022 15:02:29 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1078DC061212 for ; Wed, 5 Jan 2022 12:02:29 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id p1-20020a1c7401000000b00345c2d068bdso2560761wmc.3 for ; Wed, 05 Jan 2022 12:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=Njb5DPFe4z0b4qnqA2YtOaY2YzMWU9CqTjmFQNlOPj4=; b=iPji7Bpdggd57vKg8Q4/N94wUE9cW1jOV590DjtWwRTD9Z5iOFavI/23/VZbluXJ64 SEvzNy9uIvsgABXGnKujjpLK8AiaY18vk8FeRIx5hax4tnXZryNv39IpAUPeji5L73r8 hCJF2RsnP1eXK0A6JVTmixtOBY4+ry1z2b5RnM0Uz24YriqaHLrwACpyJ85x/ZvwtFtw dWnDSFfEP7ObSQzsIK/cpDSgBh6oKSVywk6B0sFtwMs34PubfhFtnYC5o+1TQdQ4BvUx i2OnbK1SSFPPPT05UDMhkQj4qzWAMrPGYTqUWNWD1reNPEFTPEhRyolb8ydnFX1VlDr8 7GHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=Njb5DPFe4z0b4qnqA2YtOaY2YzMWU9CqTjmFQNlOPj4=; b=4OJjoLaKSQ6Kbds2hCqZQ60K9lGU2/xqec8sBSPGvp78oiQD2Rit9YuuT4QEo0Qjot tdBBesGeRjEYs5oEZOwU6mqfV17ilwoRt6hrNmsSP1KvvCyIdB5K6R20T5ljG0gQd+F5 pcUtBGO9xbqBc7bx2CAYM15WxnmxCOfvgA36b/qYLOwxBfw19ZiKrfpiPz1/NCnVXmRi mDKPNA6mGl70UW5MC3lL0mf8hB5QkejcHEBuqJ83lHvnU5/VerJmPCs0YxPmNrucvJRM SM0xvl1kLcvNkQRdbr/6Dozi6cNwGblY7GVnNz5V9sLrbjyUBe+17xP6Uo2urktQX3SM Sdgw== X-Gm-Message-State: AOAM530XePX5xXh9O7GlnhYRSTt3E8oOGbrNqFV+hB8+o3HZcGVzL+cH QWtzJMblHso/czopPlGtznh5pciZsrA= X-Google-Smtp-Source: ABdhPJzc6EPYCP9r0FRfWSj3Zhou4i5NH/PsUITBu2ErdEe6zv61cKLQkVZwXqSoXqa9mzghVU9HHA== X-Received: by 2002:a7b:c00d:: with SMTP id c13mr4270304wmb.99.1641412947543; Wed, 05 Jan 2022 12:02:27 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id h3sm42418122wrt.94.2022.01.05.12.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:27 -0800 (PST) Message-Id: In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:15 +0000 Subject: [PATCH v5 02/11] i18n: refactor "%s, %s and %s are mutually exclusive" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Use placeholders for constant tokens. The strings are turned into "cannot be used together" Signed-off-by: Jean-Noël Avila --- 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..5beadc07ccd 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..74b41db1cee 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..ec1c59ba53c 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..02ce779e43a 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 From patchwork Wed Jan 5 20:02:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2C6DC433F5 for ; Wed, 5 Jan 2022 20:02:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243828AbiAEUCi (ORCPT ); Wed, 5 Jan 2022 15:02:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243800AbiAEUCb (ORCPT ); Wed, 5 Jan 2022 15:02:31 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D6D8C061245 for ; Wed, 5 Jan 2022 12:02:30 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id e5so468305wrc.5 for ; Wed, 05 Jan 2022 12:02:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=jCapsCpZFk+R0JG47DyovAoee0CIflSNKqzQVDTSobs=; b=me+XDIxruVQVmQH/JSHNIJAxv8FOOsEzOjRQKTdUn3ZXwGY+3x4XlbegeOk0j/dMgd KEI9U1VsbyFdJI1ZeqZ9qiZa2QMkmUoY+5g+VrcN7sZ/3p0aeU62lQez4XOIyRPNkj1C atJZ4+qI2I9PirA9xIqDxGwMzzTurdh+Ls7z0HfkBj5oIv3rw5B3LmCWVH9jjbaG5Hkw COmR8sS5CKIUelaY8xHleID/tvDGKeTCX17QdyZdaq8fIRMkD5yuaXtDY0ULS+FDFPSg RuRWVh9fYmhk9v58FbaL4eERqKpE4sLSsRQJSkYMABJ5YrYaNp4PP/wx2x9Kqpwp7676 rjbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=jCapsCpZFk+R0JG47DyovAoee0CIflSNKqzQVDTSobs=; b=ILTqIKpqIHhBXQPXkF8/ICgFqKs50T61Z9ul44DBA1xN8nhnjk/PvYxZJ9R+vwho66 WoJ07VnExe44iNVLNWGCTOHfbxyYvfvx19eFmes6Lngf5TlLzxKV6vN7LG1fjmp2jYYa sddl4be6o48y34KqNttgBXMDAKo2rCgczliv2vr/PXRw0c5n6S2d6Y0f5+nc8+pKsKBd K/oMKszkZ49jGAsOdky/2J6GLUBxjdMfYD0E50cFMdCl2m94wgHlZZzuq3G95DqnSoAi OuKp09eyx7L1PoKvkhYxDv3MatmC2Pj419BM1qH3fzHIBXssGT86ubPCo66igk1Wmq6w sxlA== X-Gm-Message-State: AOAM530WKlpuvL4lbfKtkN00OnekE/G2fwCJJK9ww1yUdJ80hGGL3cFA Y6bk568n+/zzzkMSZ4l2j+1cvRr8gDA= X-Google-Smtp-Source: ABdhPJzFjwv3t/jRnX72zoQHiUOnZK5hKNsiEU2iO9bgFxyUQ3k9FVMXU7X2NZEIK68LZG8HB+dQLw== X-Received: by 2002:a05:6000:180c:: with SMTP id m12mr1639530wrh.494.1641412948274; Wed, 05 Jan 2022 12:02:28 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o14sm3704690wms.4.2022.01.05.12.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:27 -0800 (PST) Message-Id: <80390ce08edbade5acc62439fdcdc02b905b152c.1641412945.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:16 +0000 Subject: [PATCH v5 03/11] i18n: turn "options are incompatible" into "cannot be used together" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Signed-off-by: Jean-Noël Avila --- apply.c | 2 +- archive.c | 2 +- builtin/add.c | 8 ++++---- builtin/branch.c | 2 +- builtin/checkout.c | 8 ++++---- builtin/clone.c | 2 +- builtin/commit.c | 6 +++--- builtin/describe.c | 2 +- builtin/difftool.c | 2 +- builtin/fast-export.c | 2 +- builtin/index-pack.c | 2 +- builtin/ls-files.c | 2 +- builtin/merge.c | 4 ++-- builtin/pack-objects.c | 2 +- builtin/push.c | 8 ++++---- builtin/rebase.c | 6 +++--- builtin/repack.c | 4 ++-- builtin/reset.c | 4 ++-- builtin/rev-list.c | 2 +- builtin/show-branch.c | 4 ++-- builtin/stash.c | 4 ++-- builtin/tag.c | 4 ++-- revision.c | 20 ++++++++++---------- t/t2026-checkout-pathspec-file.sh | 4 ++-- t/t2072-restore-pathspec-file.sh | 2 +- t/t3431-rebase-fork-point.sh | 2 +- t/t3704-add-pathspec-file.sh | 6 +++--- t/t3909-stash-pathspec-file.sh | 2 +- t/t5606-clone-options.sh | 2 +- t/t7107-reset-pathspec-file.sh | 2 +- t/t7526-commit-pathspec-file.sh | 6 +++--- 31 files changed, 64 insertions(+), 64 deletions(-) diff --git a/apply.c b/apply.c index fed195250b6..cabcdbe425a 100644 --- a/apply.c +++ b/apply.c @@ -133,7 +133,7 @@ int check_apply_state(struct apply_state *state, int force_apply) int is_not_gitdir = !startup_info->have_repository; if (state->apply_with_reject && state->threeway) - return error(_("--reject and --3way cannot be used together.")); + return error(_("options '%s' and '%s' cannot be used together"), "--reject", "--3way"); if (state->threeway) { if (is_not_gitdir) return error(_("--3way outside a repository")); diff --git a/archive.c b/archive.c index a3bbb091256..e85ba169088 100644 --- a/archive.c +++ b/archive.c @@ -581,7 +581,7 @@ static int parse_archive_args(int argc, const char **argv, if (output) die(_("Unexpected option --output")); if (is_remote && args->extra_files.nr) - die(_("Options --add-file and --remote cannot be used together")); + die(_("options '%s' and '%s' cannot be used together"), "--add-file", "--remote"); if (!base) base = ""; diff --git a/builtin/add.c b/builtin/add.c index a010b2c325f..4b2754345ad 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -507,9 +507,9 @@ int cmd_add(int argc, const char **argv, const char *prefix) add_interactive = 1; if (add_interactive) { if (show_only) - die(_("--dry-run is incompatible with --interactive/--patch")); + die(_("options '%s' and '%s' cannot be used together"), "--dry-run", "--interactive/--patch"); if (pathspec_from_file) - die(_("--pathspec-from-file is incompatible with --interactive/--patch")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch"); exit(interactive_add(argv + 1, prefix, patch_interactive)); } if (legacy_stash_p) { @@ -526,7 +526,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) if (edit_interactive) { if (pathspec_from_file) - die(_("--pathspec-from-file is incompatible with --edit")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--edit"); return(edit_patch(argc, argv, prefix)); } argc--; @@ -538,7 +538,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) addremove = 0; /* "-u" was given but not "-A" */ if (addremove && take_worktree_changes) - die(_("-A and -u are mutually incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "-A", "-u"); if (!show_only && ignore_missing) die(_("Option --ignore-missing can only be used together with --dry-run")); diff --git a/builtin/branch.c b/builtin/branch.c index 6c8b0fcc11f..0e93865371c 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -722,7 +722,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix) finalize_colopts(&colopts, -1); if (filter.verbose) { if (explicitly_enable_column(colopts)) - die(_("--column and --verbose are incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "--column", "--verbose"); colopts = 0; } diff --git a/builtin/checkout.c b/builtin/checkout.c index 79014e1cb6c..73f5a6fbfa1 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -464,10 +464,10 @@ static int checkout_paths(const struct checkout_opts *opts, die(_("'%s' cannot be used with updating paths"), "--detach"); if (opts->merge && opts->patch_mode) - die(_("'%s' cannot be used with %s"), "--merge", "--patch"); + die(_("options '%s' and '%s' cannot be used together"), "--merge", "--patch"); if (opts->ignore_unmerged && opts->merge) - die(_("'%s' cannot be used with %s"), + die(_("options '%s' and '%s' cannot be used together"), opts->ignore_unmerged_opt, "-m"); if (opts->new_branch) @@ -1749,10 +1749,10 @@ static int checkout_main(int argc, const char **argv, const char *prefix, die(_("--pathspec-from-file is incompatible with pathspec arguments")); if (opts->force_detach) - die(_("--pathspec-from-file is incompatible with --detach")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--detach"); if (opts->patch_mode) - die(_("--pathspec-from-file is incompatible with --patch")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch"); parse_pathspec_file(&opts->pathspec, 0, 0, diff --git a/builtin/clone.c b/builtin/clone.c index fb377b27657..13bdbe14b2f 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -903,7 +903,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) die(_("--bare and --origin %s options are incompatible."), option_origin); if (real_git_dir) - die(_("--bare and --separate-git-dir are incompatible.")); + die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir"); option_no_checkout = 1; } diff --git a/builtin/commit.c b/builtin/commit.c index 883c16256c8..067c795ca4b 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -355,10 +355,10 @@ static const char *prepare_index(const char **argv, const char *prefix, if (pathspec_from_file) { if (interactive) - die(_("--pathspec-from-file is incompatible with --interactive/--patch")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch"); if (all) - die(_("--pathspec-from-file with -a does not make sense")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "-a"); if (pathspec.nr) die(_("--pathspec-from-file is incompatible with pathspec arguments")); @@ -1193,7 +1193,7 @@ static void finalize_deferred_config(struct wt_status *s) status_format == STATUS_FORMAT_UNSPECIFIED) status_format = STATUS_FORMAT_PORCELAIN; else if (status_format == STATUS_FORMAT_LONG) - die(_("--long and -z are incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "--long", "-z"); } if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED) diff --git a/builtin/describe.c b/builtin/describe.c index e912ba50d7b..fd5ba1fc604 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -590,7 +590,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix) save_commit_buffer = 0; if (longformat && abbrev == 0) - die(_("--long is incompatible with --abbrev=0")); + die(_("options '%s' and '%s' cannot be used together"), "--long", "--abbrev=0"); if (contains) { struct string_list_item *item; diff --git a/builtin/difftool.c b/builtin/difftool.c index 5beadc07ccd..c79fbbf67e5 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -730,7 +730,7 @@ int cmd_difftool(int argc, const char **argv, const char *prefix) setenv(GIT_DIR_ENVIRONMENT, absolute_path(get_git_dir()), 1); setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1); } else if (dir_diff) - die(_("--dir-diff is incompatible with --no-index")); + die(_("options '%s' and '%s' cannot be used together"), "--dir-diff", "--no-index"); if (use_gui_tool + !!difftool_cmd + !!extcmd > 1) die(_("options '%s', '%s', and '%s' cannot be used together"), "--gui", "--tool", "--extcmd"); diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 8e2caf72819..1f8fe7b3ac1 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -1269,7 +1269,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) printf("feature done\n"); if (import_filename && import_filename_if_exists) - die(_("Cannot pass both --import-marks and --import-marks-if-exists")); + die(_("options '%s' and '%s' cannot be used together"), "--import-marks", "--import-marks-if-exists"); if (import_filename) import_marks(import_filename, 0); else if (import_filename_if_exists) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index c23d01de7dc..30ce2ac746d 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1849,7 +1849,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix) if (from_stdin && !startup_info->have_repository) die(_("--stdin requires a git repository")); if (from_stdin && hash_algo) - die(_("--object-format cannot be used with --stdin")); + die(_("options '%s' and '%s' cannot be used together"), "--object-format", "--stdin"); if (!index_name && pack_name) index_name = derive_filename(pack_name, "pack", "idx", &index_name_buf); diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 031fef1bcaa..9c80cdae951 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -767,7 +767,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix) * would not make any sense with this option. */ if (show_stage || show_unmerged) - die("ls-files --with-tree is incompatible with -s or -u"); + die(_("options '%s' and '%s' cannot be used together"), "ls-files --with-tree", "-s/-u"); overlay_tree_on_index(the_repository->index, with_tree, max_prefix); } diff --git a/builtin/merge.c b/builtin/merge.c index 5f0476b0b76..6db961e9d34 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1396,9 +1396,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix) if (squash) { if (fast_forward == FF_NO) - die(_("You cannot combine --squash with --no-ff.")); + die(_("options '%s' and '%s' cannot be used together"), "--squash", "--no-ff."); if (option_commit > 0) - die(_("You cannot combine --squash with --commit.")); + die(_("options '%s' and '%s' cannot be used together"), "--squash", "--commit."); /* * squash can now silently disable option_commit - this is not * a problem as it is only overriding the default, not a user diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index b36ed828d8d..ba2006f2212 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -4070,7 +4070,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) die(_("--thin cannot be used to build an indexable pack")); if (keep_unreachable && unpack_unreachable) - die(_("--keep-unreachable and --unpack-unreachable are incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "--unpack-unreachable"); if (!rev_list_all || !rev_list_reflog || !rev_list_index) unpack_unreachable_expiration = 0; diff --git a/builtin/push.c b/builtin/push.c index 4b026ce6c6a..359db90321c 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -589,7 +589,7 @@ int cmd_push(int argc, const char **argv, const char *prefix) set_push_cert_flags(&flags, push_cert); if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR)))) - die(_("--delete is incompatible with --all, --mirror and --tags")); + die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--mirror/--tags"); if (deleterefs && argc < 2) die(_("--delete doesn't make sense without any refs")); @@ -627,18 +627,18 @@ int cmd_push(int argc, const char **argv, const char *prefix) if (flags & TRANSPORT_PUSH_ALL) { if (tags) - die(_("--all and --tags are incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "--all", "--tags"); if (argc >= 2) die(_("--all can't be combined with refspecs")); } if (flags & TRANSPORT_PUSH_MIRROR) { if (tags) - die(_("--mirror and --tags are incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "--mirror", "--tags"); if (argc >= 2) die(_("--mirror can't be combined with refspecs")); } if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR)) - die(_("--all and --mirror are incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "--all", "--mirror"); if (!is_empty_cas(&cas) && (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES)) cas.use_force_if_includes = 1; diff --git a/builtin/rebase.c b/builtin/rebase.c index 34b4744e5f3..16e6053b14a 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1190,13 +1190,13 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) if (keep_base) { if (options.onto_name) - die(_("cannot combine '--keep-base' with '--onto'")); + die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--onto"); if (options.root) - die(_("cannot combine '--keep-base' with '--root'")); + die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--root"); } if (options.root && options.fork_point > 0) - die(_("cannot combine '--root' with '--fork-point'")); + die(_("options '%s' and '%s' cannot be used together"), "--root", "--fork-point"); if (action != ACTION_NONE && !in_progress) die(_("No rebase in progress?")); diff --git a/builtin/repack.c b/builtin/repack.c index 9b0be6a6ab3..b7b54781bd2 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -681,7 +681,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) if (keep_unreachable && (unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE))) - die(_("--keep-unreachable and -A are incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "-A"); if (write_bitmaps < 0) { if (!write_midx && @@ -712,7 +712,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) if (geometric_factor) { if (pack_everything) - die(_("--geometric is incompatible with -A, -a")); + die(_("options '%s' and '%s' cannot be used together"), "--geometric", "-A/-a"); init_pack_geometry(&geometry); split_pack_geometry(geometry, geometric_factor); } diff --git a/builtin/reset.c b/builtin/reset.c index b1ff699b43a..248998fd6fa 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -423,7 +423,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) if (pathspec_from_file) { if (patch_mode) - die(_("--pathspec-from-file is incompatible with --patch")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch"); if (pathspec.nr) die(_("--pathspec-from-file is incompatible with pathspec arguments")); @@ -459,7 +459,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) if (patch_mode) { if (reset_type != NONE) - die(_("--patch is incompatible with --{hard,mixed,soft}")); + die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}"); trace2_cmd_mode("patch-interactive"); return run_add_interactive(rev, "--patch=reset", &pathspec); } diff --git a/builtin/rev-list.c b/builtin/rev-list.c index 36cb909ebaa..c1a3b0b3591 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -538,7 +538,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) const char *arg = argv[i]; if (skip_prefix(arg, "--missing=", &arg)) { if (revs.exclude_promisor_objects) - die(_("cannot combine --exclude-promisor-objects and --missing")); + die(_("options '%s' and '%s' cannot be used together"), "--exclude-promisor-objects", "--missing"); if (parse_missing_action_value(arg)) break; } diff --git a/builtin/show-branch.c b/builtin/show-branch.c index f1e8318592c..e12c5e80e3e 100644 --- a/builtin/show-branch.c +++ b/builtin/show-branch.c @@ -707,8 +707,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix) * * Also --all and --remotes do not make sense either. */ - die(_("--reflog is incompatible with --all, --remotes, " - "--independent or --merge-base")); + die(_("options '%s' and '%s' cannot be used together"), "--reflog", + "--all/--remotes/--independent/--merge-base"); } /* If nothing is specified, show all branches by default */ diff --git a/builtin/stash.c b/builtin/stash.c index 18c812bbe03..4d793bd0b52 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1700,10 +1700,10 @@ static int push_stash(int argc, const char **argv, const char *prefix, if (pathspec_from_file) { if (patch_mode) - die(_("--pathspec-from-file is incompatible with --patch")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch"); if (only_staged) - die(_("--pathspec-from-file is incompatible with --staged")); + die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--staged"); if (ps.nr) die(_("--pathspec-from-file is incompatible with pathspec arguments")); diff --git a/builtin/tag.c b/builtin/tag.c index 41863c5ab77..dfdcfd37956 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -522,7 +522,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) finalize_colopts(&colopts, -1); if (cmdmode == 'l' && filter.lines != -1) { if (explicitly_enable_column(colopts)) - die(_("--column and -n are incompatible")); + die(_("options '%s' and '%s' cannot be used together"), "--column", "-n"); colopts = 0; } sorting = ref_sorting_options(&sorting_options); @@ -564,7 +564,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) if (msg.given || msgfile) { if (msg.given && msgfile) - die(_("only one -F or -m option is allowed.")); + die(_("options '%s' and '%s' cannot be used together"), "-F", "-m"); if (msg.given) strbuf_addbuf(&buf, &(msg.buf)); else { diff --git a/revision.c b/revision.c index 5390a479b30..d28b63a3253 100644 --- a/revision.c +++ b/revision.c @@ -2300,11 +2300,11 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->left_only = 1; } else if (!strcmp(arg, "--right-only")) { if (revs->left_only) - die("--right-only is incompatible with --left-only"); + die(_("options '%s' and '%s' cannot be used together"), "--right-only", "--left-only"); revs->right_only = 1; } else if (!strcmp(arg, "--cherry")) { if (revs->left_only) - die("--cherry is incompatible with --left-only"); + die(_("options '%s' and '%s' cannot be used together"), "--cherry", "--left-only"); revs->cherry_mark = 1; revs->right_only = 1; revs->max_parents = 1; @@ -2313,12 +2313,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->count = 1; } else if (!strcmp(arg, "--cherry-mark")) { if (revs->cherry_pick) - die("--cherry-mark is incompatible with --cherry-pick"); + die(_("options '%s' and '%s' cannot be used together"), "--cherry-mark", "--cherry-pick"); revs->cherry_mark = 1; revs->limited = 1; /* needs limit_list() */ } else if (!strcmp(arg, "--cherry-pick")) { if (revs->cherry_mark) - die("--cherry-pick is incompatible with --cherry-mark"); + die(_("options '%s' and '%s' cannot be used together"), "--cherry-pick", "--cherry-mark"); revs->cherry_pick = 1; revs->limited = 1; } else if (!strcmp(arg, "--objects")) { @@ -2524,7 +2524,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg return opts; } if (revs->graph && revs->track_linear) - die("--show-linear-break and --graph are incompatible"); + die(_("options '%s' and '%s' cannot be used together"), "--show-linear-break", "--graph"); return 1; } @@ -2867,22 +2867,22 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s compile_grep_patterns(&revs->grep_filter); if (revs->reverse && revs->reflog_info) - die("cannot combine --reverse with --walk-reflogs"); + die(_("options '%s' and '%s' cannot be used together"), "--reverse", "--walk-reflogs"); if (revs->reflog_info && revs->limited) die("cannot combine --walk-reflogs with history-limiting options"); if (revs->rewrite_parents && revs->children.name) - die("cannot combine --parents and --children"); + die(_("options '%s' and '%s' cannot be used together"), "--parents", "--children"); /* * Limitations on the graph functionality */ if (revs->reverse && revs->graph) - die("cannot combine --reverse with --graph"); + die(_("options '%s' and '%s' cannot be used together"), "--reverse", "--graph"); if (revs->reflog_info && revs->graph) - die("cannot combine --walk-reflogs with --graph"); + die(_("options '%s' and '%s' cannot be used together"), "--walk-reflogs", "--graph"); if (revs->no_walk && revs->graph) - die("cannot combine --no-walk with --graph"); + die(_("options '%s' and '%s' cannot be used together"), "--no-walk", "--graph"); if (!revs->reflog_info && revs->grep_filter.use_reflog_filter) die("cannot use --grep-reflog without --walk-reflogs"); diff --git a/t/t2026-checkout-pathspec-file.sh b/t/t2026-checkout-pathspec-file.sh index 9db11f86dd6..fbe26de2f90 100755 --- a/t/t2026-checkout-pathspec-file.sh +++ b/t/t2026-checkout-pathspec-file.sh @@ -149,10 +149,10 @@ test_expect_success 'error conditions' ' echo fileA.t >list && test_must_fail git checkout --pathspec-from-file=list --detach 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --detach" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--detach. cannot be used together" err && test_must_fail git checkout --pathspec-from-file=list --patch 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err && test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && diff --git a/t/t2072-restore-pathspec-file.sh b/t/t2072-restore-pathspec-file.sh index b48345bf95f..ad1fc0ed071 100755 --- a/t/t2072-restore-pathspec-file.sh +++ b/t/t2072-restore-pathspec-file.sh @@ -152,7 +152,7 @@ test_expect_success 'error conditions' ' >empty_list && test_must_fail git restore --pathspec-from-file=list --patch --source=HEAD^1 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err && test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh index 4c98d99e7e8..1d0b15380ed 100755 --- a/t/t3431-rebase-fork-point.sh +++ b/t/t3431-rebase-fork-point.sh @@ -83,7 +83,7 @@ test_expect_success 'git rebase --fork-point with ambigous refname' ' test_expect_success '--fork-point and --root both given' ' test_must_fail git rebase --fork-point --root 2>err && - test_i18ngrep "cannot combine" err + test_i18ngrep "cannot be used together" err ' test_expect_success 'rebase.forkPoint set to false' ' diff --git a/t/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh index 5d5164d1fc6..7e17ae80229 100755 --- a/t/t3704-add-pathspec-file.sh +++ b/t/t3704-add-pathspec-file.sh @@ -138,13 +138,13 @@ test_expect_success 'error conditions' ' >empty_list && test_must_fail git add --pathspec-from-file=list --interactive 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && test_must_fail git add --pathspec-from-file=list --patch 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && test_must_fail git add --pathspec-from-file=list --edit 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --edit" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err && test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err && test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && diff --git a/t/t3909-stash-pathspec-file.sh b/t/t3909-stash-pathspec-file.sh index 55e050cfd4d..aae2b25f766 100755 --- a/t/t3909-stash-pathspec-file.sh +++ b/t/t3909-stash-pathspec-file.sh @@ -88,7 +88,7 @@ test_expect_success 'error conditions' ' echo fileA.t >list && test_must_fail git stash push --pathspec-from-file=list --patch 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err && test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh index d822153e4d2..3af3577af0b 100755 --- a/t/t5606-clone-options.sh +++ b/t/t5606-clone-options.sh @@ -54,7 +54,7 @@ test_expect_success 'disallows --bare with --separate-git-dir' ' test_must_fail git clone --bare --separate-git-dir dot-git-destiation parent clone-bare-sgd 2>err && test_debug "cat err" && - test_i18ngrep -e "--bare and --separate-git-dir are incompatible" err + test_i18ngrep -e "options .--bare. and .--separate-git-dir. cannot be used together" err ' diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh index 15ccb14f7e2..b211fbc0a52 100755 --- a/t/t7107-reset-pathspec-file.sh +++ b/t/t7107-reset-pathspec-file.sh @@ -160,7 +160,7 @@ test_expect_success 'error conditions' ' git rm fileA.t && test_must_fail git reset --pathspec-from-file=list --patch 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && test_must_fail git reset --pathspec-from-file=list -- fileA.t 2>err && test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && diff --git a/t/t7526-commit-pathspec-file.sh b/t/t7526-commit-pathspec-file.sh index dca62fc48e5..574cf30285c 100755 --- a/t/t7526-commit-pathspec-file.sh +++ b/t/t7526-commit-pathspec-file.sh @@ -141,13 +141,13 @@ test_expect_success 'error conditions' ' >empty_list && test_must_fail git commit --pathspec-from-file=list --interactive -m "Commit" 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && test_must_fail git commit --pathspec-from-file=list --patch -m "Commit" 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && + test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && test_must_fail git commit --pathspec-from-file=list --all -m "Commit" 2>err && - test_i18ngrep -e "--pathspec-from-file with -a does not make sense" err && + test_i18ngrep -e "options .--pathspec-from-file. and .-a. cannot be used together" err && test_must_fail git commit --pathspec-from-file=list -m "Commit" -- fileA.t 2>err && test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && From patchwork Wed Jan 5 20:02:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0C1BC43217 for ; Wed, 5 Jan 2022 20:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243827AbiAEUCh (ORCPT ); Wed, 5 Jan 2022 15:02:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243801AbiAEUCb (ORCPT ); Wed, 5 Jan 2022 15:02:31 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936ABC061201 for ; Wed, 5 Jan 2022 12:02:30 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id d9so572504wrb.0 for ; Wed, 05 Jan 2022 12:02:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=2i7GcNJ78FgiIt8YPh4wnGl4jPlfW6qzCRzbbzfKR7A=; b=UqrPiexJlwSXjhukLCSF8VCSMW03ug7SeuRvita02zd13Vu2J/g7ZfnVFl/Mplzwty lKtml0c2WiE0i/mkbe3J8SfF5ghhNuMvQ9ybFdDURZOFz4pxA2dS2Tu7oAcji2jWwSfy UoK342H9xjjiCO2HzyyU/lLadGmHxovnVbJHhtpGgw3OsKgKRLhvIoHLk2p8190ohsEl IRM5BCo53tn82IYQXlU0zyX5BzYWQSj98nwzZ0f0pt5l1WCMYe/5oBfhaGnCGj/I3xza aaFn4u8WVJbpodXcRgFnWtnxHYBsdNrsbW2APncFxqthZZUUK81ZPUTr/3i1I8+iL+y6 igcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=2i7GcNJ78FgiIt8YPh4wnGl4jPlfW6qzCRzbbzfKR7A=; b=C1dzUHBenk2FChhNfO7Q4kRaK0pkH9Eyh+to775gl55PT5Pis/hoXvc8wjH3VRfshW msTYaz4zC5achzme3bZvPxc9EviXZnHTWHmqCIiJ4AmfYjbxLq9M3xHhmuWjnN8w6cLD 9r/rkIXhcM8tiYYP/N96XEN3P4BVCD7v4wg3cG+tsdFQjlJwtkzROJ+Nk4PWXFM6ydkR x/Jd5ldlPq7fltnKeqUjIK4tH9lXBWQ2pbbDRSni0CD6G1dkDUK6hFi0yRKqOx488o4J mzs4uk9oV1qh2afXBt58imPdgrNDnwcyaqoKQXrim2Omqg2ptYDDXcIsx/l9iM0UTBUo ykSA== X-Gm-Message-State: AOAM533lv/zRtYEcs9Lkq4QgwzAxoMlFKsd26TIuzmbXv6SFcA5Vj8ZS aKx5z4WZocn4p+x3hl9PPt+JfVsQATs= X-Google-Smtp-Source: ABdhPJzqOW73jKE9FFVMNeFm0WPyLXZwTLczLIrNgRAIzm7RAhBoeZDoJuC24gNqQRckKuMT+a4lcA== X-Received: by 2002:a5d:6da3:: with SMTP id u3mr45196395wrs.712.1641412948896; Wed, 05 Jan 2022 12:02:28 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id c7sm47367008wri.21.2022.01.05.12.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:28 -0800 (PST) Message-Id: <49e41dc136fd28a0054176754ef8941acd63ab82.1641412945.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:17 +0000 Subject: [PATCH v5 04/11] i18n: standardize "cannot open" and "cannot read" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Signed-off-by: Jean-Noël Avila --- archive.c | 4 ++-- builtin/fetch.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/archive.c b/archive.c index e85ba169088..78d35467008 100644 --- a/archive.c +++ b/archive.c @@ -185,7 +185,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base, buffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size); if (!buffer) - return error(_("cannot read %s"), oid_to_hex(oid)); + return error(_("cannot read '%s'"), oid_to_hex(oid)); err = write_entry(args, oid, path.buf, path.len, mode, buffer, size); free(buffer); return err; @@ -338,7 +338,7 @@ int write_archive_entries(struct archiver_args *args, strbuf_reset(&content); if (strbuf_read_file(&content, path, info->stat.st_size) < 0) - err = error_errno(_("could not read '%s'"), path); + err = error_errno(_("cannot read '%s'"), path); else err = write_entry(args, &fake_oid, path_in_archive.buf, path_in_archive.len, diff --git a/builtin/fetch.c b/builtin/fetch.c index 2c584c85812..c0855c363fd 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -996,7 +996,7 @@ static int open_fetch_head(struct fetch_head *fetch_head) if (write_fetch_head) { fetch_head->fp = fopen(filename, "a"); if (!fetch_head->fp) - return error_errno(_("cannot open %s"), filename); + return error_errno(_("cannot open '%s'"), filename); strbuf_init(&fetch_head->buf, 0); } else { fetch_head->fp = NULL; @@ -1408,7 +1408,7 @@ static int truncate_fetch_head(void) FILE *fp = fopen_for_writing(filename); if (!fp) - return error_errno(_("cannot open %s"), filename); + return error_errno(_("cannot open '%s'"), filename); fclose(fp); return 0; } From patchwork Wed Jan 5 20:02:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 110A9C433F5 for ; Wed, 5 Jan 2022 20:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243841AbiAEUCn (ORCPT ); Wed, 5 Jan 2022 15:02:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243804AbiAEUCc (ORCPT ); Wed, 5 Jan 2022 15:02:32 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45A50C061212 for ; Wed, 5 Jan 2022 12:02:31 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id c66so371322wma.5 for ; Wed, 05 Jan 2022 12:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=6B3Wz5JTSb7Z5RBwq2lLEIjujXvQYK+iJjyySfyByyA=; b=R2S1btn2AjRK7b1/RCoQFj2/8o8eCav368+PvOCozgy03ji1L+NHhMS75nj7jRVZI9 Fop1alnUkNRcByV8jWIIofNIpORrKJDMn/Cc1s9lyG+dEMUvJfLUKL0CeFK1auZLkW9G i9zF3uhkydsFYR78e43oyrVEzP1lvpqtg9iTXzkF7BkPcuk/s+55rSANcU5LMMllDHBr lkMhf1ZX2RucsdXjhGqppwJ/B7X7V62ViuD862NUYuZJoAiotEFiDrnadGwOd9T+eCIp XAk6pdBdxUaBDH9+UJV43K1v1WtbugIfa+38NtBUlhb+pUpRCH8IIEW5uPIIYPCppnvE YznQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=6B3Wz5JTSb7Z5RBwq2lLEIjujXvQYK+iJjyySfyByyA=; b=K8G3iLl+vX0sCJjonuFlJN8teDOtSVuJWE11bvAhsxajm29TcyLTHaE9aFDqwHEuMn OqKrvkRU64OPp/PBrw/3V3Jgo7coXGbbjvwGyx3B5TbLmT0R5o7dT++0RjQ/59GlwOqA U4FTma4Gkv1SPrcBKYaiFu3EADNDTlwI78t1O+zf/ndkaz9YoATqFh/F8pbFvEor7Olf so0InflOYSw0YXZ866VYNSNgc3oru2ATvifmPeSd9AAJ5ybMZijhQwM4XaytpjUeZ+c9 3x9uEvf4iowYKCWPz1E5mDX231XY/yicvNJ8luOBH5aP30v2p6nAOLVA0quyCKn5zVJp XQuQ== X-Gm-Message-State: AOAM533IiSyVcJI92Ts+KF9l+z0358KHOZLI2BpMF4WI7tsBBrdyrVDf DwZ6H61fwPI+dUSREVAoVkDeLOxna9g= X-Google-Smtp-Source: ABdhPJytWiU6JZ+cLBMhOntRtTBZuXcCqIHyQ+gs/bSs5YX2zMGnFwdkgDCltGBg2XaHvLNQzS2C2g== X-Received: by 2002:a7b:c3c5:: with SMTP id t5mr4202095wmj.168.1641412949720; Wed, 05 Jan 2022 12:02:29 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m35sm7469973wms.1.2022.01.05.12.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:29 -0800 (PST) Message-Id: In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:18 +0000 Subject: [PATCH v5 05/11] i18n: tag.c factorize i18n strings MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Signed-off-by: Jean-Noël Avila --- builtin/tag.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index dfdcfd37956..8f372a41078 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -483,6 +483,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) OPT_END() }; int ret = 0; + const char *only_in_list = NULL; setup_ref_filter_porcelain_msg(); @@ -542,15 +543,19 @@ int cmd_tag(int argc, const char **argv, const char *prefix) goto cleanup; } if (filter.lines != -1) - die(_("-n option is only allowed in list mode")); - if (filter.with_commit) - die(_("--contains option is only allowed in list mode")); - if (filter.no_commit) - die(_("--no-contains option is only allowed in list mode")); - if (filter.points_at.nr) - die(_("--points-at option is only allowed in list mode")); - if (filter.reachable_from || filter.unreachable_from) - die(_("--merged and --no-merged options are only allowed in list mode")); + only_in_list = "-n"; + else if (filter.with_commit) + only_in_list = "--contains"; + else if (filter.no_commit) + only_in_list = "--no-contains"; + else if (filter.points_at.nr) + only_in_list = "--points-at"; + else if (filter.reachable_from) + only_in_list = "--merged"; + else if (filter.unreachable_from) + only_in_list = "--no-merged"; + if (only_in_list) + die(_("the '%s' option is only allowed in list mode"), only_in_list); if (cmdmode == 'd') { ret = delete_tags(argv); goto cleanup; From patchwork Wed Jan 5 20:02:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA416C433EF for ; Wed, 5 Jan 2022 20:02:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243866AbiAEUCx (ORCPT ); Wed, 5 Jan 2022 15:02:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243806AbiAEUCc (ORCPT ); Wed, 5 Jan 2022 15:02:32 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41935C0611FD for ; Wed, 5 Jan 2022 12:02:32 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id n19-20020a7bc5d3000000b003466ef16375so2577225wmk.1 for ; Wed, 05 Jan 2022 12:02:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=PQUt0Cns5LFAhe2Yj5Lsy7RLAGOQ3wTB8IUMFI6AdWE=; b=Q7+74HYEPMqi4r7p0rOb8rh9pyVzV6dIs4BMVqXuB6GKRnVoAuhE8FIaPt/Xet5UUC DNbZ3pfTw9WOv2liaqc7M1BI12zpYXIuMBsbofG2kaRzjD6zni63l7Oh1U3pLWHanD6q xnjE0p9/t3Xit0OXiSVNf0Q1tIC6ccb9DvYEeyHHgIBegWk31QSKcBqD4xq3i2xFUIIw K0n4PjdWAQ+nDDPE0ohvFopz3yZI08Zxe3SjFtzAZIQP1OrJXV2uI1ZLY30KktjXRcUv wy4oGZ+usYaF6IQ2Ll5lrIpNAZJOKMs2Jz5uMdbR0rnjuTil3n/Ru8s/n2+pFMvbnGKE wSNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=PQUt0Cns5LFAhe2Yj5Lsy7RLAGOQ3wTB8IUMFI6AdWE=; b=hz7PK5snmQPMxGU7r28MiZ3Y2bZbuYQUhzplukd6rfJqxG5dC4ByOQIoMrObIqTeHa w1XpntdKvjhbkRCXKLJMpUJ0A8EjynigMc9O0oUF0Y+zEmAZAmG3GpjpHIjg142Hb+iW wwt8azHqZ4uRGSM+IoIxOm5/rXcx9ibOVpUXvzUzWWPUddbj79YurS+Aznt8TO4f989e 1C4NTir2tRkbRzhd5g3KS+sMxNw6gDNvwiUkVu3+B9ncLqN6c4a8/NkjBnZuEMtwT6GB 8rTWOu7ufk7flW/Pofm/T45hc7JR1LLc+8r7ZBPjoqaOewCPBSDfAAr1qKHmPoF1mO12 otPw== X-Gm-Message-State: AOAM531ucqXCRl4TKNUT4ffpNR4a/PKhxS4LIPhyLGvsIVr89TTU3lMe yoX8U49VGWyii8C9QGq4qC0LaOhRmZ0= X-Google-Smtp-Source: ABdhPJwv2ig/LRL2tr542Lvvp/DJRRJRlfO2i6P0JjzawDdLHjYvTbcHbmDw0vp888h9D0FTLjWRvQ== X-Received: by 2002:a05:600c:294:: with SMTP id 20mr4201690wmk.7.1641412950509; Wed, 05 Jan 2022 12:02:30 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l2sm42404125wru.83.2022.01.05.12.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:30 -0800 (PST) Message-Id: In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:19 +0000 Subject: [PATCH v5 06/11] i18n: factorize "--foo requires --bar" and the like MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= They are all replaced by "the option '%s' requires '%s'", which is a new string but replaces 17 previous unique strings. Signed-off-by: Jean-Noël Avila --- archive.c | 2 +- builtin/add.c | 4 ++-- builtin/checkout.c | 2 +- builtin/commit.c | 2 +- builtin/fast-export.c | 2 +- builtin/index-pack.c | 2 +- builtin/log.c | 2 +- builtin/reset.c | 4 ++-- builtin/rm.c | 2 +- builtin/stash.c | 2 +- builtin/worktree.c | 2 +- fetch-pack.c | 2 +- http-fetch.c | 4 ++-- revision.c | 2 +- t/t2026-checkout-pathspec-file.sh | 2 +- t/t2072-restore-pathspec-file.sh | 2 +- t/t3601-rm-pathspec-file.sh | 2 +- t/t3704-add-pathspec-file.sh | 2 +- t/t3909-stash-pathspec-file.sh | 2 +- t/t7107-reset-pathspec-file.sh | 2 +- t/t7526-commit-pathspec-file.sh | 2 +- 21 files changed, 24 insertions(+), 24 deletions(-) diff --git a/archive.c b/archive.c index 78d35467008..d571249cf39 100644 --- a/archive.c +++ b/archive.c @@ -577,7 +577,7 @@ static int parse_archive_args(int argc, const char **argv, if (remote) die(_("Unexpected option --remote")); if (exec) - die(_("Option --exec can only be used together with --remote")); + die(_("the option '%s' requires '%s'"), "--exec", "--remote"); if (output) die(_("Unexpected option --output")); if (is_remote && args->extra_files.nr) diff --git a/builtin/add.c b/builtin/add.c index 4b2754345ad..067ec53d69f 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -541,7 +541,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) die(_("options '%s' and '%s' cannot be used together"), "-A", "-u"); if (!show_only && ignore_missing) - die(_("Option --ignore-missing can only be used together with --dry-run")); + die(_("the option '%s' requires '%s'"), "--ignore-missing", "--dry-run"); if (chmod_arg && ((chmod_arg[0] != '-' && chmod_arg[0] != '+') || chmod_arg[1] != 'x' || chmod_arg[2])) @@ -573,7 +573,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) PATHSPEC_SYMLINK_LEADING_PATH, prefix, pathspec_from_file, pathspec_file_nul); } else if (pathspec_file_nul) { - die(_("--pathspec-file-nul requires --pathspec-from-file")); + die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); } if (require_pathspec && pathspec.nr == 0) { diff --git a/builtin/checkout.c b/builtin/checkout.c index 73f5a6fbfa1..af5fa8228eb 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1758,7 +1758,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix, 0, prefix, opts->pathspec_from_file, opts->pathspec_file_nul); } else if (opts->pathspec_file_nul) { - die(_("--pathspec-file-nul requires --pathspec-from-file")); + die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); } opts->pathspec.recursive = 1; diff --git a/builtin/commit.c b/builtin/commit.c index 067c795ca4b..49e7477747f 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -367,7 +367,7 @@ static const char *prepare_index(const char **argv, const char *prefix, PATHSPEC_PREFER_FULL, prefix, pathspec_from_file, pathspec_file_nul); } else if (pathspec_file_nul) { - die(_("--pathspec-file-nul requires --pathspec-from-file")); + die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); } if (!pathspec.nr && (also || (only && !allow_empty && diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 1f8fe7b3ac1..f4d9aa1e8d1 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -1254,7 +1254,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) usage_with_options (fast_export_usage, options); if (anonymized_seeds.cmpfn && !anonymize) - die(_("--anonymize-map without --anonymize does not make sense")); + die(_("the option '%s' requires '%s'"), "--anonymize-map", "--anonymize"); if (refspecs_list.nr) { int i; diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 30ce2ac746d..3c2e6aee3cc 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1845,7 +1845,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix) if (!pack_name && !from_stdin) usage(index_pack_usage); if (fix_thin_pack && !from_stdin) - die(_("--fix-thin cannot be used without --stdin")); + die(_("the option '%s' requires '%s'"), "--fix-thin", "--stdin"); if (from_stdin && !startup_info->have_repository) die(_("--stdin requires a git repository")); if (from_stdin && hash_algo) diff --git a/builtin/log.c b/builtin/log.c index 74b41db1cee..ded042f3e01 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -2112,7 +2112,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (creation_factor < 0) creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT; else if (!rdiff_prev) - die(_("--creation-factor requires --range-diff")); + die(_("the option '%s' requires '%s'"), "--creation-factor", "--range-diff"); if (rdiff_prev) { if (!cover_letter && total != 1) diff --git a/builtin/reset.c b/builtin/reset.c index 248998fd6fa..4779e70dfbe 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -432,7 +432,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) PATHSPEC_PREFER_FULL, prefix, pathspec_from_file, pathspec_file_nul); } else if (pathspec_file_nul) { - die(_("--pathspec-file-nul requires --pathspec-from-file")); + die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); } unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid); @@ -490,7 +490,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) _(reset_type_names[reset_type])); if (intent_to_add && reset_type != MIXED) - die(_("-N can only be used with --mixed")); + die(_("the option '%s' requires '%s'"), "-N", "--mixed"); prepare_repo_settings(the_repository); the_repository->settings.command_requires_full_index = 0; diff --git a/builtin/rm.c b/builtin/rm.c index 3d0967cdc11..cfdf24cf49a 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -278,7 +278,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix) PATHSPEC_PREFER_CWD, prefix, pathspec_from_file, pathspec_file_nul); } else if (pathspec_file_nul) { - die(_("--pathspec-file-nul requires --pathspec-from-file")); + die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); } if (!pathspec.nr) diff --git a/builtin/stash.c b/builtin/stash.c index 4d793bd0b52..3e3743fd5a3 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1712,7 +1712,7 @@ static int push_stash(int argc, const char **argv, const char *prefix, PATHSPEC_PREFER_FULL | PATHSPEC_PREFIX_ORIGIN, prefix, pathspec_from_file, pathspec_file_nul); } else if (pathspec_file_nul) { - die(_("--pathspec-file-nul requires --pathspec-from-file")); + die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); } return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode, diff --git a/builtin/worktree.c b/builtin/worktree.c index ec1c59ba53c..2838254f7f2 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -505,7 +505,7 @@ static int add(int ac, const char **av, const char *prefix) if (!!opts.detach + !!new_branch + !!new_branch_force > 1) die(_("options '%s', '%s', and '%s' cannot be used together"), "-b", "-B", "--detach"); if (lock_reason && !keep_locked) - die(_("--reason requires --lock")); + die(_("the option '%s' requires '%s'"), "--reason", "--lock"); if (lock_reason) opts.keep_locked = lock_reason; else if (keep_locked) diff --git a/fetch-pack.c b/fetch-pack.c index 34987a2c30d..dd6ec449f2d 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -297,7 +297,7 @@ static int find_common(struct fetch_negotiator *negotiator, struct packet_reader reader; if (args->stateless_rpc && multi_ack == 1) - die(_("--stateless-rpc requires multi_ack_detailed")); + die(_("the option '%s' requires '%s'"), "--stateless-rpc", "multi_ack_detailed"); packet_reader_init(&reader, fd[0], NULL, 0, PACKET_READ_CHOMP_NEWLINE | diff --git a/http-fetch.c b/http-fetch.c index c7c7d391ac5..58b394cd47f 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -141,7 +141,7 @@ int cmd_main(int argc, const char **argv) if (packfile) { if (!index_pack_args.nr) - die(_("--packfile requires --index-pack-args")); + die(_("the option '%s' requires '%s'"), "--packfile", "--index-pack-args"); fetch_single_packfile(&packfile_hash, argv[arg], index_pack_args.v); @@ -150,7 +150,7 @@ int cmd_main(int argc, const char **argv) } if (index_pack_args.nr) - die(_("--index-pack-args can only be used with --packfile")); + die(_("the option '%s' requires '%s'"), "--index-pack-args", "--packfile"); if (commits_on_stdin) { commits = walker_targets_stdin(&commit_id, &write_ref); diff --git a/revision.c b/revision.c index d28b63a3253..13ccc6829f1 100644 --- a/revision.c +++ b/revision.c @@ -2884,7 +2884,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s if (revs->no_walk && revs->graph) die(_("options '%s' and '%s' cannot be used together"), "--no-walk", "--graph"); if (!revs->reflog_info && revs->grep_filter.use_reflog_filter) - die("cannot use --grep-reflog without --walk-reflogs"); + die(_("the option '%s' requires '%s'"), "--grep-reflog", "--walk-reflogs"); if (revs->line_level_traverse && (revs->diffopt.output_format & ~(DIFF_FORMAT_PATCH | DIFF_FORMAT_NO_OUTPUT))) diff --git a/t/t2026-checkout-pathspec-file.sh b/t/t2026-checkout-pathspec-file.sh index fbe26de2f90..9e6b17e2d23 100755 --- a/t/t2026-checkout-pathspec-file.sh +++ b/t/t2026-checkout-pathspec-file.sh @@ -158,7 +158,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && test_must_fail git checkout --pathspec-file-nul 2>err && - test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err + test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err ' test_done diff --git a/t/t2072-restore-pathspec-file.sh b/t/t2072-restore-pathspec-file.sh index ad1fc0ed071..af67ca7d52b 100755 --- a/t/t2072-restore-pathspec-file.sh +++ b/t/t2072-restore-pathspec-file.sh @@ -158,7 +158,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err && - test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && + test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && test_must_fail git restore --pathspec-from-file=empty_list --source=HEAD^1 2>err && test_i18ngrep -e "you must specify path(s) to restore" err diff --git a/t/t3601-rm-pathspec-file.sh b/t/t3601-rm-pathspec-file.sh index b2a8db69afc..bbed67f8ef5 100755 --- a/t/t3601-rm-pathspec-file.sh +++ b/t/t3601-rm-pathspec-file.sh @@ -70,7 +70,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && test_must_fail git rm --pathspec-file-nul 2>err && - test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && + test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && >empty_list && test_must_fail git rm --pathspec-from-file=empty_list 2>err && diff --git a/t/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh index 7e17ae80229..47ad96bf661 100755 --- a/t/t3704-add-pathspec-file.sh +++ b/t/t3704-add-pathspec-file.sh @@ -150,7 +150,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && test_must_fail git add --pathspec-file-nul 2>err && - test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && + test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && # This case succeeds, but still prints to stderr git add --pathspec-from-file=empty_list 2>err && diff --git a/t/t3909-stash-pathspec-file.sh b/t/t3909-stash-pathspec-file.sh index aae2b25f766..fde4625cfcb 100755 --- a/t/t3909-stash-pathspec-file.sh +++ b/t/t3909-stash-pathspec-file.sh @@ -94,7 +94,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && test_must_fail git stash push --pathspec-file-nul 2>err && - test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err + test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err ' test_done diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh index b211fbc0a52..f753e3229e2 100755 --- a/t/t7107-reset-pathspec-file.sh +++ b/t/t7107-reset-pathspec-file.sh @@ -166,7 +166,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && test_must_fail git reset --pathspec-file-nul 2>err && - test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && + test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && test_must_fail git reset --soft --pathspec-from-file=list 2>err && test_i18ngrep -e "fatal: Cannot do soft reset with paths" err && diff --git a/t/t7526-commit-pathspec-file.sh b/t/t7526-commit-pathspec-file.sh index 574cf30285c..ea69e3a6ad1 100755 --- a/t/t7526-commit-pathspec-file.sh +++ b/t/t7526-commit-pathspec-file.sh @@ -153,7 +153,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err && - test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && + test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && test_must_fail git commit --pathspec-from-file=empty_list --include -m "Commit" 2>err && test_i18ngrep -e "No paths with --include/--only does not make sense." err && From patchwork Wed Jan 5 20:02:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D281C433F5 for ; Wed, 5 Jan 2022 20:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243857AbiAEUCt (ORCPT ); Wed, 5 Jan 2022 15:02:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243798AbiAEUCd (ORCPT ); Wed, 5 Jan 2022 15:02:33 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC24AC061245 for ; Wed, 5 Jan 2022 12:02:32 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id h23so510913wrc.1 for ; Wed, 05 Jan 2022 12:02:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=JIocY6VcxAOywLFzw0OnVpMN7lpFCNvRMkP6pq4asjc=; b=Qd8sGl5XzC+Mi3kQ+eR0WT7wwgFYp+2YQhBHLRvFOC1ob+KmT4PhdrDXUX2kycYmPD 3oUAMkAVHLBf0NmT5wfWWG2ZzMWCynC81Z1hXM1qkaA0A91g6ugjPNaiFx75vf4L4hiv dOfrbUPbZ7m47zhJKkq7pE5QA+Dc2JpgYn+gejnp16Rs9CenqPGEMA2+AK0ZbtP9z1ex +Ke2zH1w4Dql2rtl+Fyr0cxhAEbJtUHQ7zKrLMF1AD9bB1bLy3FWzZFS9EdM4Ig1M0QY 5naN9kVMUluM7sacce6kR/iZpWUTuK7zWC9R33RwIn9O+cxxPrQ7aXaSLQqdY3XKoAow dtdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=JIocY6VcxAOywLFzw0OnVpMN7lpFCNvRMkP6pq4asjc=; b=5/E2j2nzbLvsFM2k/agwjztQFpQJ74SMYFkrbfy1/Oot6avwcfvkc3XEZ7GcSOf8dK t6r3BbqYU2cVbry0AS98jUCP13ajdeFjmk0ywpcJOGzvxXvvd+WoXnm8rIVahtoG9ueW 1A+iqB9SDya6yZRP4HXSfEkbh0R7VsoNC3cxFCI6AMb1oTt94/11IGZK15F689wGfqUC HzkgqEQXYzf/9hcTlIi3hnE/rbKPe8SYUoyVjTl+QpWY4VPCm+rWza4svIp/wOOor9LO JKiWcYDmmXoKxngVdb9eGP/yLPri+VJJEaxyO2wqmLaZhoLsUiAvWl+HYt46nLzjif1q 2P1g== X-Gm-Message-State: AOAM531PGTxnCEZ9/VW7rORdiLKeBfaBJquwYxzPMNpNrOPzSVz/l0tF G7Y+D1WmakzFMGjX7JGr/LRfHzrW7nU= X-Google-Smtp-Source: ABdhPJzq5i8JuvLBAeOtKpTsQxU8VgBy5cx39Ef2Wy1XFDnzrH763SK3ESmfAf7tDuceDVydxTtdZw== X-Received: by 2002:a5d:6312:: with SMTP id i18mr46642937wru.475.1641412951303; Wed, 05 Jan 2022 12:02:31 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t25sm981085wmj.26.2022.01.05.12.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:30 -0800 (PST) Message-Id: <08f5471aeaa9c14a340f5876a161144da0a34dc9.1641412945.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:20 +0000 Subject: [PATCH v5 07/11] i18n: factorize "no directory given for --foo" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Signed-off-by: Jean-Noël Avila --- git.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git.c b/git.c index 7edafd8ecff..edda922ce6d 100644 --- a/git.c +++ b/git.c @@ -185,7 +185,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) *envchanged = 1; } else if (!strcmp(cmd, "--git-dir")) { if (*argc < 2) { - fprintf(stderr, _("no directory given for --git-dir\n" )); + fprintf(stderr, _("no directory given for '%s' option\n" ), "--git-dir"); usage(git_usage_string); } setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1); @@ -213,7 +213,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) *envchanged = 1; } else if (!strcmp(cmd, "--work-tree")) { if (*argc < 2) { - fprintf(stderr, _("no directory given for --work-tree\n" )); + fprintf(stderr, _("no directory given for '%s' option\n" ), "--work-tree"); usage(git_usage_string); } setenv(GIT_WORK_TREE_ENVIRONMENT, (*argv)[1], 1); @@ -297,7 +297,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) *envchanged = 1; } else if (!strcmp(cmd, "-C")) { if (*argc < 2) { - fprintf(stderr, _("no directory given for -C\n" )); + fprintf(stderr, _("no directory given for '%s' option\n" ), "-C"); usage(git_usage_string); } if ((*argv)[1][0]) { From patchwork Wed Jan 5 20:02:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 663CCC433F5 for ; Wed, 5 Jan 2022 20:02:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243872AbiAEUC4 (ORCPT ); Wed, 5 Jan 2022 15:02:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243808AbiAEUCd (ORCPT ); Wed, 5 Jan 2022 15:02:33 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8644FC061201 for ; Wed, 5 Jan 2022 12:02:33 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id f134-20020a1c1f8c000000b00345c05bc12dso61189wmf.3 for ; Wed, 05 Jan 2022 12:02:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=lJ3JP/DgW2qFrsjmp5khrg3BgbmcWXCzjZiWjRlHLBc=; b=JoSuTCuiFSIf5LS+lcYSfFHwZWzY0Il4ZMg577JKMqy6s7DLzPWBA1QhQbXnCxdndD a8XruauaUDL8ZcsP9NgMNS+pqoPcFw1jeZj/D3kUAZUl4/fhi5lkkmafd99cTbMAnX/+ LSY1hnryeS5pGkBS9N18QA395o0dUnPaMLhHWOEQH5K/X38mV+4TpllmJg4aRAjsx+EH g7f9WfQYdN+t4YkAChmKFZsKsCYtPgBqpski3PTfZ+nQyYvbDZNrPGKaC0gUtxPZwCuB d71jgLP/SzLZzygiPtif4RlFtyUouaQMhOsi2O1X/ONHsiX6CzmcZa7fUvOQLPTTj9Xf lxGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=lJ3JP/DgW2qFrsjmp5khrg3BgbmcWXCzjZiWjRlHLBc=; b=k/3yHRkJDE+u3N2BWzfVY0vosHekhdCBsOu99jiUBhRCPlpc8LWSkmakjuacZ3I2WO g3V3ak4ZJtkiUFckBjKJY+qlfnHXP0q1HOqKRZuc9szztUk1GdSR4YgDjl2P3cPjktfm 9zekJaBjzgKYIHwkzXFGTs36/UbN/EJZJxcoD3ZvJCcLlymG4UmYyJhnFFBwtj4LRBpG 3wJObjD4RA8h6HbAhWU1bUzLyl3BhQYIVbr9BpuIJN56vGp5iHZPraRYx2jhrwxwyvn1 lKMYuosGvJ/EgLEN4Ug6bLUVtrt4F6RV4Fmy0nhJPaFrH/1Y4bp7ivnU4ZQEDZ34TYbI 3Prw== X-Gm-Message-State: AOAM53320CSyDF/0+NtHgoAO0nEnCo87LPBvhZmgBUML4esbElSMrXXn 1SDjry9GXkzh1iIsdvyMjgvTs3EfBg4= X-Google-Smtp-Source: ABdhPJxeRoYiI7iGWilR8lPXhLIlhLDzbrzW2CiOSvTJP/T38VUCquQaeexMvok8KTQxbAyvPOZdOQ== X-Received: by 2002:a7b:cd82:: with SMTP id y2mr4286651wmj.99.1641412951979; Wed, 05 Jan 2022 12:02:31 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o12sm46690989wrc.69.2022.01.05.12.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:31 -0800 (PST) Message-Id: <437aadbc2c9f4469d8fd22bb4433d69f085600df.1641412945.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:21 +0000 Subject: [PATCH v5 08/11] i18n: refactor "unrecognized %(foo) argument" strings MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Signed-off-by: Jean-Noël Avila --- ref-filter.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 7260fce31d0..adbcc680812 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -341,7 +341,7 @@ static int objectsize_atom_parser(struct ref_format *format, struct used_atom *a else oi.info.disk_sizep = &oi.disk_size; } else - return strbuf_addf_ret(err, -1, _("unrecognized %%(objectsize) argument: %s"), arg); + return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "objectsize", arg); return 0; } @@ -374,7 +374,7 @@ static int subject_atom_parser(struct ref_format *format, struct used_atom *atom else if (!strcmp(arg, "sanitize")) atom->u.contents.option = C_SUB_SANITIZE; else - return strbuf_addf_ret(err, -1, _("unrecognized %%(subject) argument: %s"), arg); + return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "subject", arg); return 0; } @@ -428,7 +428,7 @@ static int contents_atom_parser(struct ref_format *format, struct used_atom *ato if (strtoul_ui(arg, 10, &atom->u.contents.nlines)) return strbuf_addf_ret(err, -1, _("positive value expected contents:lines=%s"), arg); } else - return strbuf_addf_ret(err, -1, _("unrecognized %%(contents) argument: %s"), arg); + return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "contents", arg); return 0; } @@ -440,7 +440,7 @@ static int raw_atom_parser(struct ref_format *format, struct used_atom *atom, else if (!strcmp(arg, "size")) atom->u.raw_data.option = RAW_LENGTH; else - return strbuf_addf_ret(err, -1, _("unrecognized %%(raw) argument: %s"), arg); + return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "raw", arg); return 0; } @@ -459,7 +459,7 @@ static int oid_atom_parser(struct ref_format *format, struct used_atom *atom, if (atom->u.oid.length < MINIMUM_ABBREV) atom->u.oid.length = MINIMUM_ABBREV; } else - return strbuf_addf_ret(err, -1, _("unrecognized argument '%s' in %%(%s)"), arg, atom->name); + return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), atom->name, arg); return 0; } @@ -531,7 +531,7 @@ static int align_atom_parser(struct ref_format *format, struct used_atom *atom, else if ((position = parse_align_position(s)) >= 0) align->position = position; else { - strbuf_addf(err, _("unrecognized %%(align) argument: %s"), s); + strbuf_addf(err, _("unrecognized %%(%s) argument: %s"), "align", s); string_list_clear(¶ms, 0); return -1; } @@ -557,7 +557,7 @@ static int if_atom_parser(struct ref_format *format, struct used_atom *atom, } else if (skip_prefix(arg, "notequals=", &atom->u.if_then_else.str)) { atom->u.if_then_else.cmp_status = COMPARE_UNEQUAL; } else - return strbuf_addf_ret(err, -1, _("unrecognized %%(if) argument: %s"), arg); + return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "if", arg); return 0; } From patchwork Wed Jan 5 20:02:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704692 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4837AC433F5 for ; Wed, 5 Jan 2022 20:03:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243880AbiAEUDD (ORCPT ); Wed, 5 Jan 2022 15:03:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243811AbiAEUCe (ORCPT ); Wed, 5 Jan 2022 15:02:34 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BB88C061245 for ; Wed, 5 Jan 2022 12:02:34 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id d9so572773wrb.0 for ; Wed, 05 Jan 2022 12:02:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=pXWKSago48SUiIPycSF/8IJoON9YEFLRN7skWH994fY=; b=aHOewuEO+hpoyput67U8mjyhvcZMCwKarBC6GyT73/hXVG7nfqYWLqbxf+trl78lHO 9TLFgRsdhMb4Cx+WTPGvHphpWBhU3SgJQV6UVd/e8NHPSXGI6xNzP9AWwAWXmpDztr+L g6IxBawrICxS1/kcyN4ExDbxaHap/uzkrwL7/2qRuuk0OlN/3ey//WoWCnSR7xuk78Vz lft3LM6vU2R9mOafob/5UCvybVyByAilnQqBB4mGzT7b1kRFW9U2pnKGYVB7+MXdkjc+ UJEhULQI1gERG1qeAktKMZC3A1OW6dLa9nXI67UM4LpIqxI99yleocHdr3eWOGiVMVgO x0Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=pXWKSago48SUiIPycSF/8IJoON9YEFLRN7skWH994fY=; b=eNRI5BMMJOLTZQezXbWj9q1BJlCRnOxCuPqKlCXSm0D/1mgHVmuIfqO49JQIwZUepe VMW5qifFmBoo+LMDniEfw6xtrFJfEibyL6DvI6Jm1JxH4bHC1xhzk58VJeOADarg9Ufv gI8p/HJDppi1QUKQ49H+jnvF8hvUZbuk22D61rKsaSajwvfSp3FWovdNGwpXEe4966bS yHNr2JrUMFLv8qsjVFDpR3jCYXi/W/3eJCoFenM4VQLhA5xIdzjjI5VYP2QS90gXzJFr FwwLkertIVNvzUdEdY5SMeDHS7V7g15f+XJAN2IlyPpBXbtDx/oIGxGepDyazEgxlfw/ 3yjQ== X-Gm-Message-State: AOAM53114izciy1xiLwpncI0SgSbwq/TJG+yRq7AlEUb4adBRhwrDmf7 VwjC+s4zI4F0+eNA7j/1NECu8tBNmPY= X-Google-Smtp-Source: ABdhPJwQGT/rQwCTh73vWCgLm5EbtMufR9hUhO7CP/4E6D3D+SpxZgR8j9ACBGdhm3Jo9ojQqy5qOw== X-Received: by 2002:a5d:47c3:: with SMTP id o3mr47849280wrc.29.1641412952698; Wed, 05 Jan 2022 12:02:32 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m17sm3538101wmq.31.2022.01.05.12.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:32 -0800 (PST) Message-Id: <7d97ee5dd18d2935c35448fe1989ecba9f5c1fdd.1641412945.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:22 +0000 Subject: [PATCH v5 09/11] i18n: factorize "--foo outside a repository" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Signed-off-by: Jean-Noël Avila --- apply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apply.c b/apply.c index cabcdbe425a..5cd369d5736 100644 --- a/apply.c +++ b/apply.c @@ -136,7 +136,7 @@ int check_apply_state(struct apply_state *state, int force_apply) return error(_("options '%s' and '%s' cannot be used together"), "--reject", "--3way"); if (state->threeway) { if (is_not_gitdir) - return error(_("--3way outside a repository")); + return error(_("'%s' outside a repository"), "--3way"); state->check_index = 1; } if (state->apply_with_reject) { @@ -147,10 +147,10 @@ int check_apply_state(struct apply_state *state, int force_apply) if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor)) state->apply = 0; if (state->check_index && is_not_gitdir) - return error(_("--index outside a repository")); + return error(_("'%s' outside a repository"), "--index"); if (state->cached) { if (is_not_gitdir) - return error(_("--cached outside a repository")); + return error(_("'%s' outside a repository"), "--cached"); state->check_index = 1; } if (state->ita_only && (state->check_index || is_not_gitdir)) From patchwork Wed Jan 5 20:02:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43ADAC433EF for ; Wed, 5 Jan 2022 20:03:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243885AbiAEUDF (ORCPT ); Wed, 5 Jan 2022 15:03:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243815AbiAEUCf (ORCPT ); Wed, 5 Jan 2022 15:02:35 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E80F3C061201 for ; Wed, 5 Jan 2022 12:02:34 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id k18so413346wrg.11 for ; Wed, 05 Jan 2022 12:02:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=rP4kEq8FF2OINWVr/x+I8nI+cifT9FovCOINQK1WOY0=; b=fe6zN4tyHnmhQTycg3R+CPF07juxxhw1mNdBOEhgCb1lfYbSszpuomYqFbpBYavnXx fe5AdTAkTLpGSK3ptqU75Hjeda8biuIc9clbPd4Oc/3ChpZ7d8YHc7jF7kbUVWrKV4Yi L90OlfEKt3G19049cgnsIqPpnDUL1at5VVqNsj/R6c+vAYryr8BCz1hXxykQcMktBrGp sUfJMFcouPOVcIeQJSF5yfPjSnVUWtyRCeMdyQ1ujz4ZQ9oUQIiyCV2WsQIqL+ao1hFx d1MHXi6G/S4ehzrAlCW8A2iqnz2ZojngKq9hhGzRXgVo7gHVdKyBUKPGWzyCqa5Rvp24 BT2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=rP4kEq8FF2OINWVr/x+I8nI+cifT9FovCOINQK1WOY0=; b=qOjI/PQBhs3ukI1GSIEcUbKjolPndpOYYm6yXpIlL9NKpNU1Qz1BOVQYSBceZYgpAO 1wsOcrw7088aoJCUkVRvMyfA+rHaaUHPYPFJO3lUPDrrhD5M0ipN6B5hKjHMKwQpkpiP vT73+pyuGP6t/QhhUrKT3Sda4PFAZQuCiU2biTk+mXTVTC4RE6toK6dCFNfcq4okxqKe Zlc/SVJDugw3YIUIZY9kY7FxgUm/ZBUXEPiP1O9WonGIe2pq7XhXp78j1BqfR9DpiwqK Vd1rQFoTzDIgqyMCuFdnRoKAjva7AZ+7hhVUkoBVsVNWs4A+J+Ty5Cm0oxAKGQpAmURW ENDw== X-Gm-Message-State: AOAM5334yRhTXtWqXsfhuV/swRMx1rAvE/QP5R8XnVkb8K93i1uOnJda cw7vYw9uPkDKzjqJ1ML4AM577j7L/qQ= X-Google-Smtp-Source: ABdhPJwCLy6mEAxT01C8rmAM+FOlcA7B+4LEI8upTOpaT0Rt2FqDJAXpE/t8my34JxzCQ2EAMWxVdA== X-Received: by 2002:a5d:6da2:: with SMTP id u2mr46674011wrs.633.1641412953444; Wed, 05 Jan 2022 12:02:33 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u10sm44107712wrs.28.2022.01.05.12.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:33 -0800 (PST) Message-Id: <226c105559ce5f524131212076aa00b595be2492.1641412945.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:23 +0000 Subject: [PATCH v5 10/11] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Signed-off-by: Jean-Noël Avila --- ref-filter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index adbcc680812..f7a2f17bfd9 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -841,7 +841,7 @@ static void if_then_else_handler(struct ref_formatting_stack **stack) struct if_then_else *if_then_else = (struct if_then_else *)cur->at_end_data; if (!if_then_else->then_atom_seen) - die(_("format: %%(if) atom used without a %%(then) atom")); + die(_("format: %%(%s) atom used without a %%(%s) atom"), "if", "then"); if (if_then_else->else_atom_seen) { /* @@ -907,7 +907,7 @@ static int then_atom_handler(struct atom_value *atomv, struct ref_formatting_sta if (cur->at_end == if_then_else_handler) if_then_else = (struct if_then_else *)cur->at_end_data; if (!if_then_else) - return strbuf_addf_ret(err, -1, _("format: %%(then) atom used without an %%(if) atom")); + return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "then", "if"); if (if_then_else->then_atom_seen) return strbuf_addf_ret(err, -1, _("format: %%(then) atom used more than once")); if (if_then_else->else_atom_seen) @@ -943,9 +943,9 @@ static int else_atom_handler(struct atom_value *atomv, struct ref_formatting_sta if (prev->at_end == if_then_else_handler) if_then_else = (struct if_then_else *)prev->at_end_data; if (!if_then_else) - return strbuf_addf_ret(err, -1, _("format: %%(else) atom used without an %%(if) atom")); + return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "else", "if"); if (!if_then_else->then_atom_seen) - return strbuf_addf_ret(err, -1, _("format: %%(else) atom used without a %%(then) atom")); + return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "else", "then"); if (if_then_else->else_atom_seen) return strbuf_addf_ret(err, -1, _("format: %%(else) atom used more than once")); if_then_else->else_atom_seen = 1; From patchwork Wed Jan 5 20:02:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila?= X-Patchwork-Id: 12704685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01561C433EF for ; Wed, 5 Jan 2022 20:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243822AbiAEUC7 (ORCPT ); Wed, 5 Jan 2022 15:02:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243826AbiAEUCh (ORCPT ); Wed, 5 Jan 2022 15:02:37 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60599C0611FD for ; Wed, 5 Jan 2022 12:02:36 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id v10-20020a05600c214a00b00345e59928eeso2596734wml.0 for ; Wed, 05 Jan 2022 12:02:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=ZseRlkeqhvefzV48rq9H7//0CvPXn6/dac9K0bmAGEY=; b=ehAySW9BBrqexnjYlyCnnKrPl3NEileedoKk86yAwcML5jsQEPpEPwM7U7ntKq/yB1 DZdF1VvhkzmHYm7tQ3lMzLQOt4VGoxcY5wlS14QeGm2NdmVVn4TatwpPXW10/Bpt0bSC cR4+eq5jYUG27F5pNSYxPLdqyJ0SQmlrBS1avVXwT7454l+v9V4eMHvc6yNkK9FXbaH+ qKtDOzBCkGaDWvoWbFiGV8r1ertRkFuOe4FU5e8RS3GMNPh0TOQ2e0t7rr+rINi0fp3a VwBKdM7sm+voyMutjUAKXJ7QB6Ek+4wRymjdDnu/IYIPZCx2bnFVxGNKwawP45NEtQZS AbdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=ZseRlkeqhvefzV48rq9H7//0CvPXn6/dac9K0bmAGEY=; b=YcXWvSKlAbzRVgp5KWjwj78sXbSPXUpjboHIwoD0OYKCVB8DReM+uru1QLGsl6siLY FuqYPMg5nktHuuKPTwwIqrY+Ksnnv23ve6mAyz+AI+tm82xUPOqiyW1vLaNJYxyMPZYQ EuGqOrWZPaoLozUoRkUbaupH6SH6MQTYGdZdb3JAJRj4pReDKxJU4c3pYuqn7z0D5qlz Lq7pFvxD97sn/cJHwmfuDoFd/k3+OtJOkI1YAt6CDkDYQa9lrie+y8bS87NucATg8EGe w56/54Ynuj5PyOSu7wClD/3TDJ7iLKyj2H7VeP5U0PbVx1MIVlDmx1m0JW1ZOcNsYMEI NJuA== X-Gm-Message-State: AOAM53093XVG5O4LWGMW7ZtdYhCUVI+Pk9jZtigQG6Layho5+1Bwn41R CQDRyjIB6cGokxhX9LlynxK4WAP5hnw= X-Google-Smtp-Source: ABdhPJxDzFiFG5raPXMnooBFPrdSCxZz2rcAZu9m3wcu6l+S+QA1OlWlTddXjiLOwJEl9jYJqkt9RQ== X-Received: by 2002:a05:600c:a03:: with SMTP id z3mr4219428wmp.73.1641412954202; Wed, 05 Jan 2022 12:02:34 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f8sm44704481wry.16.2022.01.05.12.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 12:02:33 -0800 (PST) Message-Id: <8bcc814ba008d351b065b4919729eb5ed12b2904.1641412945.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Wed, 05 Jan 2022 20:02:24 +0000 Subject: [PATCH v5 11/11] i18n: turn even more messages into "cannot be used together" ones MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Jeff King , Johannes Sixt , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsA==?= Bjarmason , =?utf-8?b?UmVuw6k=?= Scharfe , =?utf-8?q?Jean-No=C3=ABl?= Avila , =?utf-8?q?Jean-No?= =?utf-8?q?=C3=ABl_Avila?= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?utf-8?q?Jean-No=C3=ABl_Avila?= From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Even if some of these messages are not subject to gettext i18n, this helps bring a single style of message for a given error type. Signed-off-by: Jean-Noël Avila --- builtin/add.c | 2 +- builtin/am.c | 6 +++--- builtin/cat-file.c | 2 +- builtin/checkout.c | 6 +++--- builtin/clone.c | 4 ++-- builtin/commit.c | 9 +++++---- builtin/describe.c | 4 ++-- builtin/rebase.c | 4 ++-- builtin/reset.c | 2 +- builtin/rev-list.c | 2 +- builtin/rm.c | 2 +- builtin/stash.c | 2 +- diff.c | 12 ++++++++---- t/t2026-checkout-pathspec-file.sh | 2 +- t/t2072-restore-pathspec-file.sh | 2 +- t/t3601-rm-pathspec-file.sh | 2 +- t/t3704-add-pathspec-file.sh | 2 +- t/t3909-stash-pathspec-file.sh | 2 +- t/t4209-log-pickaxe.sh | 4 ++-- t/t5606-clone-options.sh | 2 +- t/t7107-reset-pathspec-file.sh | 2 +- t/t7500-commit-template-squash-signoff.sh | 11 ++++++----- t/t7526-commit-pathspec-file.sh | 2 +- 23 files changed, 47 insertions(+), 41 deletions(-) diff --git a/builtin/add.c b/builtin/add.c index 067ec53d69f..84dff3e7969 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -566,7 +566,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) if (pathspec_from_file) { if (pathspec.nr) - die(_("--pathspec-from-file is incompatible with pathspec arguments")); + die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); parse_pathspec_file(&pathspec, PATHSPEC_ATTR, PATHSPEC_PREFER_FULL | diff --git a/builtin/am.c b/builtin/am.c index 8677ea2348a..68a190dd9f5 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -2230,9 +2230,9 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar } if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode) - return error(_("--show-current-patch=%s is incompatible with " - "--show-current-patch=%s"), - arg, valid_modes[resume->sub_mode]); + return error(_("options '%s=%s' and '%s=%s' " + "cannot be used together"), + "--show-current-patch", "--show-current-patch", arg, valid_modes[resume->sub_mode]); resume->mode = RESUME_SHOW_PATCH; resume->sub_mode = new_value; diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 86fc03242b8..d94050e6c18 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -729,7 +729,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix) } if (force_path && batch.enabled) { - error("--path= incompatible with --batch"); + error("options '--path=' and '--batch' cannot be used together"); usage_with_options(cat_file_usage, options); } diff --git a/builtin/checkout.c b/builtin/checkout.c index af5fa8228eb..eb3a69c2120 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1635,8 +1635,8 @@ static int checkout_main(int argc, const char **argv, const char *prefix, } if ((!!opts->new_branch + !!opts->new_branch_force + !!opts->new_orphan_branch) > 1) - die(_("-%c, -%c and --orphan are mutually exclusive"), - cb_option, toupper(cb_option)); + die(_("options '-%c', '-%c', and '%s' cannot be used together"), + cb_option, toupper(cb_option), "--orphan"); if (opts->overlay_mode == 1 && opts->patch_mode) die(_("options '%s' and '%s' cannot be used together"), "-p", "--overlay"); @@ -1746,7 +1746,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix, if (opts->pathspec_from_file) { if (opts->pathspec.nr) - die(_("--pathspec-from-file is incompatible with pathspec arguments")); + die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); if (opts->force_detach) die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--detach"); diff --git a/builtin/clone.c b/builtin/clone.c index 13bdbe14b2f..8b79666e3a7 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -900,8 +900,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix) if (option_bare) { if (option_origin) - die(_("--bare and --origin %s options are incompatible."), - option_origin); + die(_("options '%s' and '%s %s' cannot be used together"), + "--bare", "--origin", option_origin); if (real_git_dir) die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir"); option_no_checkout = 1; diff --git a/builtin/commit.c b/builtin/commit.c index 49e7477747f..b9ed0374e30 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -361,7 +361,7 @@ static const char *prepare_index(const char **argv, const char *prefix, die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "-a"); if (pathspec.nr) - die(_("--pathspec-from-file is incompatible with pathspec arguments")); + die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); parse_pathspec_file(&pathspec, 0, PATHSPEC_PREFER_FULL, @@ -799,7 +799,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, if (!strcmp(fixup_prefix, "amend")) { if (have_option_m) - die(_("cannot combine -m with --fixup:%s"), fixup_message); + die(_("options '%s' and '%s:%s' cannot be used together"), "-m", "--fixup", fixup_message); prepare_amend_commit(commit, &sb, &ctx); } } else if (!stat(git_path_merge_msg(the_repository), &statbuf)) { @@ -1229,9 +1229,10 @@ static void check_fixup_reword_options(int argc, const char *argv[]) { die(_("You are in the middle of a cherry-pick -- cannot reword.")); } if (argc) - die(_("cannot combine reword option of --fixup with path '%s'"), *argv); + die(_("reword option of '%s' and path '%s' cannot be used together"), "--fixup", *argv); if (patch_interactive || interactive || all || also || only) - die(_("reword option of --fixup is mutually exclusive with --patch/--interactive/--all/--include/--only")); + die(_("reword option of '%s' and '%s' cannot be used together"), + "--fixup", "--patch/--interactive/--all/--include/--only"); } static int parse_and_validate_options(int argc, const char *argv[], diff --git a/builtin/describe.c b/builtin/describe.c index fd5ba1fc604..42159cd26bd 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -670,9 +670,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix) } describe("HEAD", 1); } else if (dirty) { - die(_("--dirty is incompatible with commit-ishes")); + die(_("option '%s' and commit-ishes cannot be used together"), "--dirty"); } else if (broken) { - die(_("--broken is incompatible with commit-ishes")); + die(_("option '%s' and commit-ishes cannot be used together"), "--broken"); } else { while (argc-- > 0) describe(*argv++, argc == 0); diff --git a/builtin/rebase.c b/builtin/rebase.c index 16e6053b14a..36490d06c8a 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1460,8 +1460,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) if (i >= 0) { if (is_merge(&options)) - die(_("cannot combine apply options with " - "merge options")); + die(_("apply options and merge options " + "cannot be used together")); else options.type = REBASE_APPLY; } diff --git a/builtin/reset.c b/builtin/reset.c index 4779e70dfbe..b97745ee94e 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -426,7 +426,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch"); if (pathspec.nr) - die(_("--pathspec-from-file is incompatible with pathspec arguments")); + die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); parse_pathspec_file(&pathspec, 0, PATHSPEC_PREFER_FULL, diff --git a/builtin/rev-list.c b/builtin/rev-list.c index c1a3b0b3591..777558e9b06 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -676,7 +676,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) if (revs.count && (revs.tag_objects || revs.tree_objects || revs.blob_objects) && (revs.left_right || revs.cherry_mark)) - die(_("marked counting is incompatible with --objects")); + die(_("marked counting and '%s' cannot be used together"), "--objects"); save_commit_buffer = (revs.verbose_header || revs.grep_filter.pattern_list || diff --git a/builtin/rm.c b/builtin/rm.c index cfdf24cf49a..127a6f0220c 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -272,7 +272,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix) if (pathspec_from_file) { if (pathspec.nr) - die(_("--pathspec-from-file is incompatible with pathspec arguments")); + die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); parse_pathspec_file(&pathspec, 0, PATHSPEC_PREFER_CWD, diff --git a/builtin/stash.c b/builtin/stash.c index 3e3743fd5a3..7b1876b3e31 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1706,7 +1706,7 @@ static int push_stash(int argc, const char **argv, const char *prefix, die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--staged"); if (ps.nr) - die(_("--pathspec-from-file is incompatible with pathspec arguments")); + die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); parse_pathspec_file(&ps, 0, PATHSPEC_PREFER_FULL | PATHSPEC_PREFIX_ORIGIN, diff --git a/diff.c b/diff.c index 02ce779e43a..da5fc81a543 100644 --- a/diff.c +++ b/diff.c @@ -4639,16 +4639,20 @@ void diff_setup_done(struct diff_options *options) options->set_default(options); if (HAS_MULTI_BITS(options->output_format & check_mask)) - die(_("--name-only, --name-status, --check and -s are mutually exclusive")); + die(_("options '%s', '%s', '%s', and '%s' cannot be used together"), + "--name-only", "--name-status", "--check", "-s"); if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK)) - die(_("options '%s', '%s', and '%s' cannot be used together"), "-G", "-S", "--find-object"); + 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")); + die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s'"), + "-G", "--pickaxe-regex", "--pickaxe-regex", "-S"); if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_ALL_OBJFIND_MASK)) - die(_("--pickaxe-all and --find-object are mutually exclusive, use --pickaxe-all with -G and -S")); + die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"), + "--pickaxe-all", "--find-object", "--pickaxe-all", "-G", "-S"); /* * Most of the time we can say "there are changes" diff --git a/t/t2026-checkout-pathspec-file.sh b/t/t2026-checkout-pathspec-file.sh index 9e6b17e2d23..9c651aefbca 100755 --- a/t/t2026-checkout-pathspec-file.sh +++ b/t/t2026-checkout-pathspec-file.sh @@ -155,7 +155,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && test_must_fail git checkout --pathspec-file-nul 2>err && test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err diff --git a/t/t2072-restore-pathspec-file.sh b/t/t2072-restore-pathspec-file.sh index af67ca7d52b..c22669b39f9 100755 --- a/t/t2072-restore-pathspec-file.sh +++ b/t/t2072-restore-pathspec-file.sh @@ -155,7 +155,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err && test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && diff --git a/t/t3601-rm-pathspec-file.sh b/t/t3601-rm-pathspec-file.sh index bbed67f8ef5..a2a0c820fe3 100755 --- a/t/t3601-rm-pathspec-file.sh +++ b/t/t3601-rm-pathspec-file.sh @@ -67,7 +67,7 @@ test_expect_success 'error conditions' ' echo fileA.t >list && test_must_fail git rm --pathspec-from-file=list -- fileA.t 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && test_must_fail git rm --pathspec-file-nul 2>err && test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && diff --git a/t/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh index 47ad96bf661..4e6b5177c93 100755 --- a/t/t3704-add-pathspec-file.sh +++ b/t/t3704-add-pathspec-file.sh @@ -147,7 +147,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err && test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && test_must_fail git add --pathspec-file-nul 2>err && test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && diff --git a/t/t3909-stash-pathspec-file.sh b/t/t3909-stash-pathspec-file.sh index fde4625cfcb..dead9f18d93 100755 --- a/t/t3909-stash-pathspec-file.sh +++ b/t/t3909-stash-pathspec-file.sh @@ -91,7 +91,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && test_must_fail git stash push --pathspec-file-nul 2>err && test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh index 4f820f8597d..7f6bb27f141 100755 --- a/t/t4209-log-pickaxe.sh +++ b/t/t4209-log-pickaxe.sh @@ -72,12 +72,12 @@ test_expect_success 'usage' ' grep "cannot be used together" err && test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err && - grep "mutually exclusive" err + grep "cannot be used together" err ' test_expect_success 'usage: --pickaxe-regex' ' test_expect_code 128 git log -Gregex --pickaxe-regex 2>err && - grep "mutually exclusive" err + grep "cannot be used together" err ' test_expect_success 'usage: --no-pickaxe-regex' ' diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh index 3af3577af0b..8f676d6b0c0 100755 --- a/t/t5606-clone-options.sh +++ b/t/t5606-clone-options.sh @@ -46,7 +46,7 @@ test_expect_success 'disallows --bare with --origin' ' test_must_fail git clone -o foo --bare parent clone-bare-o 2>err && test_debug "cat err" && - test_i18ngrep -e "--bare and --origin foo options are incompatible" err + test_i18ngrep -e "options .--bare. and .--origin foo. cannot be used together" err ' diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh index f753e3229e2..523efbecde1 100755 --- a/t/t7107-reset-pathspec-file.sh +++ b/t/t7107-reset-pathspec-file.sh @@ -163,7 +163,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && test_must_fail git reset --pathspec-from-file=list -- fileA.t 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && test_must_fail git reset --pathspec-file-nul 2>err && test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && diff --git a/t/t7500-commit-template-squash-signoff.sh b/t/t7500-commit-template-squash-signoff.sh index 8dd0f988129..91964653a0b 100755 --- a/t/t7500-commit-template-squash-signoff.sh +++ b/t/t7500-commit-template-squash-signoff.sh @@ -359,14 +359,14 @@ test_expect_success '--fixup=reword: ignores staged changes' ' test_expect_success '--fixup=reword: error out with -m option' ' commit_for_rebase_autosquash_setup && - echo "fatal: cannot combine -m with --fixup:reword" >expect && + echo "fatal: options '\''-m'\'' and '\''--fixup:reword'\'' cannot be used together" >expect && test_must_fail git commit --fixup=reword:HEAD~ -m "reword commit message" 2>actual && test_cmp expect actual ' test_expect_success '--fixup=amend: error out with -m option' ' commit_for_rebase_autosquash_setup && - echo "fatal: cannot combine -m with --fixup:amend" >expect && + echo "fatal: options '\''-m'\'' and '\''--fixup:amend'\'' cannot be used together" >expect && test_must_fail git commit --fixup=amend:HEAD~ -m "amend commit message" 2>actual && test_cmp expect actual ' @@ -421,8 +421,9 @@ test_expect_success 'amend! commit allows empty commit msg body with --allow-emp test_fixup_reword_opt () { test_expect_success "--fixup=reword: incompatible with $1" " - echo 'fatal: reword option of --fixup is mutually exclusive with'\ - '--patch/--interactive/--all/--include/--only' >expect && + echo 'fatal: reword option of '\''--fixup'\'' and' \ + ''\''--patch/--interactive/--all/--include/--only'\' \ + 'cannot be used together' >expect && test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual && test_cmp expect actual " @@ -435,7 +436,7 @@ done test_expect_success '--fixup=reword: give error with pathsec' ' commit_for_rebase_autosquash_setup && - echo "fatal: cannot combine reword option of --fixup with path '\''foo'\''" >expect && + echo "fatal: reword option of '\''--fixup'\'' and path '\''foo'\'' cannot be used together" >expect && test_must_fail git commit --fixup=reword:HEAD~ -- foo 2>actual && test_cmp expect actual ' diff --git a/t/t7526-commit-pathspec-file.sh b/t/t7526-commit-pathspec-file.sh index ea69e3a6ad1..ad011bb9f15 100755 --- a/t/t7526-commit-pathspec-file.sh +++ b/t/t7526-commit-pathspec-file.sh @@ -150,7 +150,7 @@ test_expect_success 'error conditions' ' test_i18ngrep -e "options .--pathspec-from-file. and .-a. cannot be used together" err && test_must_fail git commit --pathspec-from-file=list -m "Commit" -- fileA.t 2>err && - test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err && test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err &&