From patchwork Fri Dec 3 07:01:40 2021 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: 12654405 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 155E9C433EF for ; Fri, 3 Dec 2021 07:02:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378776AbhLCHFY (ORCPT ); Fri, 3 Dec 2021 02:05:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378750AbhLCHFT (ORCPT ); Fri, 3 Dec 2021 02:05:19 -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 B97F0C06174A for ; Thu, 2 Dec 2021 23:01:55 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id v11so3594853wrw.10 for ; Thu, 02 Dec 2021 23:01:55 -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=jWYQkM/mf0sUzCzXN/riq8peoiKS9S4BFGnyZA/mznw=; b=mgqTrKtptSe1xFaVL85ay413QhU4viVH8Nc1ZzXm7+UUk1b1jZKpVEaJNliC1Sx9c3 fbtGyZrexIojJCif4ISa8lyzFYVd+qdoTo2svNLApzaczjjPyzx6TXJ4gby+gv+/fMmd 5YBQguHkJRmCHRUyVyKYV4FSIUNzMcrKbn9IsTFVgVzHY7x5jmbxZgYFiT12Lmt/1jxx bWWSYv7AlbWNVp6CftiYXA5lwZ6UUrZNoHOtFld06sLPDWMo2YUFxgQgIovmHFUb9WAs 8N9k/n7VKcrWoWCm9ILkhuLjNoSDJq1AMA2qk/+6BG7ZRpQ62piLFezLzlCjdqM6NrpY KwVw== 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=jWYQkM/mf0sUzCzXN/riq8peoiKS9S4BFGnyZA/mznw=; b=zIvjvEnYLBlFIjeUTSa9dU93Ul1vqequS0ERqoGadXsoSjvyd+VnhmaW478BCKZSvc rWgvfMMJHFJ+nBetFxLgY0FNBXU2SXLc9rTpBlYHu5QegFQJDVd/rXVVMoRPKPNbVB04 LTHxsaawZnqsjFixX3fnENSGfGd2dWPEAQglIihzXkpMf6S3RMCCfATORaATOHO7sEeG vdDHsKG7p110iwC/WgEyRza0MaWxcyBhaCB//Yy7ADNJml9wIRMfGL6SKMMzGP1TPkK6 DmjtRDkCv5CCvLc6JYY6O3meD/xhJl4Xq72vbBYDLugxt8mWMMtQ+ISbOSn6c7Q40qMY o5vA== X-Gm-Message-State: AOAM531kR5eHEV0NX/jkAR8nD8cAX0smiSz3CXqaANI8FKeE5W0dscA8 MFxhMvpaR7NPVFejda3w0jkG8MI2i4g= X-Google-Smtp-Source: ABdhPJwK2i5Ec/G91d1UCjeoip5qJDdg2QQg+qNrpRgPGW62dGaoeLUgcvQfIwyX95WTjyHAUmjQGg== X-Received: by 2002:a5d:4a0a:: with SMTP id m10mr19311208wrq.221.1638514912956; Thu, 02 Dec 2021 23:01:52 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j40sm1763194wms.16.2021.12.02.23.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:52 -0800 (PST) Message-Id: <476eb77aff6fbea926eaec55c9b4febb74282ab4.1638514910.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:40 +0000 Subject: [PATCH 01/10] i18n: refactor "foo and bar are mutually exclusive" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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. Signed-off-by: Jean-Noël Avila --- builtin/checkout.c | 2 +- builtin/diff-tree.c | 2 +- builtin/fetch.c | 2 +- builtin/init-db.c | 2 +- builtin/log.c | 4 ++-- builtin/submodule--helper.c | 4 ++-- builtin/worktree.c | 2 +- range-diff.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index cbf73b8c9f6..4bd8a57f190 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1621,7 +1621,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(_("%s and %s are mutually exclusive"), "-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..08d5477486a 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(_("%s and %s are mutually exclusive"), "--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 f7abbc31ff1..bec3cc7535e 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -2012,7 +2012,7 @@ 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(_("%s and %s are mutually exclusive"), "--deepen", "--depth"); depth = xstrfmt("%d", deepen_relative); } if (unshallow) { diff --git a/builtin/init-db.c b/builtin/init-db.c index 2167796ff2a..1439e05c93d 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(_("%s and %s are mutually exclusive"), "--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 f75d87e8d7f..a2005e3c778 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1928,9 +1928,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(_("%s and %s are mutually exclusive"), "-n", "-k"); if (keep_subject && subject_prefix) - die(_("--subject-prefix/--rfc and -k are mutually exclusive")); + die(_("%s and %s are mutually exclusive"), "--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 e630f0c730e..beedd873894 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(_("%s and %s are mutually exclusive"), "--cached", "--files"); diff_cmd = DIFF_FILES; } @@ -2971,7 +2971,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(_("%s and %s are mutually exclusive"), "--branch", "--default"); if (argc != 1 || !(path = argv[0])) usage_with_options(usage, options); diff --git a/builtin/worktree.c b/builtin/worktree.c index d22ece93e1a..9287c455594 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -700,7 +700,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(_("%s and %s are mutually exclusive"), "--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..bd954988e0f 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(_("%s and %s are mutually exclusive"), "--left-only", "--right-only"); if (!res && read_patches(range1, &branch1, range_diff_opts->other_arg)) res = error(_("could not parse log for '%s'"), range1); From patchwork Fri Dec 3 07:01:41 2021 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: 12654401 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 C702EC433F5 for ; Fri, 3 Dec 2021 07:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378760AbhLCHFW (ORCPT ); Fri, 3 Dec 2021 02:05:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350984AbhLCHFT (ORCPT ); Fri, 3 Dec 2021 02:05:19 -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 53142C061758 for ; Thu, 2 Dec 2021 23:01:55 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id d24so3806146wra.0 for ; Thu, 02 Dec 2021 23:01:55 -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=Kla0Up95nG9fLDAaKha+D5grTsqperIJFk04R2nlff4=; b=YRTbch8CRzq6PeARpk/9kpanp1FkBoqTsE2lCZV2rKgNneQ9F2BEij7RwnZcnlfZSV te8AztZ96XBAAYVbHBiOjXBoODdCX/v1lQU1ioVQ2KBcMDRlriW5XNfbM9L3z10oF2ze RPLaeUNIkKDUOa1lcEt7LMV6TLgrIJkH8g8eirGIV6yb0IuGNIQ4vsCHAbUJsOOpcWWC ju0ZMOOQqCkJbSJjR05anoH/LWSWWZonpiIACUgrym3raUbpklhLjBytRbre96GLmd3o pXQXJb8h1p6aTCKaZufTn/14vWG+VryvQ1+0PAlx83y3otq1493M5mBePhBJkp0qZ+y/ naug== 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=Kla0Up95nG9fLDAaKha+D5grTsqperIJFk04R2nlff4=; b=4iy3kSjBp3SpmIXdHTF2fSPBGuLeOHOj8NON8qXkGhBmrlGsfKjJc2XilEDY/1z48X LKxcsssA8tNP1EgZZRWVhz8iwCiFOP2zhFJABvUGsn+ccdGbbm97yYC+/Sj0+6My0J1e DoaHkYajABlgmFAHxLFHiqXOiDvBixL3hAYL5r6izF1U5R2MLhE1BQiOjW00aXmWZfmA YiaVIf44CUk510jwCghSYenUOhpHULopsKJ9CuzCW5lcLeAnXoIujqdGgKXx3xclOtlW HyO+jkLaGED5jybUec5AnF6gSM5bAyApVqYJ3gDSrOBrOGaSabKgnXW6y3Tp6GHvV1iV IVuA== X-Gm-Message-State: AOAM5336pYG0oWX7Nw5YVeEqKZh1mTsuZWrpEROy+SNFwt4s4Sf4ZALW jIoydGDUFiSke45dDbqBkZkmtjdlsjU= X-Google-Smtp-Source: ABdhPJxTReErEicK1809YtT0GCqMJX8qM3MoaEml+ZpeymmGaFdpZ4Boak69YCjTCreXC36qj2qtzQ== X-Received: by 2002:a05:6000:1a45:: with SMTP id t5mr20701111wry.306.1638514913721; Thu, 02 Dec 2021 23:01:53 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id ay21sm4374565wmb.7.2021.12.02.23.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:53 -0800 (PST) Message-Id: <32c7799388b876466a2380c967e6e0dd47de2d23.1638514910.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:41 +0000 Subject: [PATCH 02/10] i18n: refactor "%s, %s and %s are mutually exclusive" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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. Signed-off-by: Jean-Noël Avila --- builtin/difftool.c | 2 +- builtin/log.c | 2 +- builtin/worktree.c | 2 +- diff.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/difftool.c b/builtin/difftool.c index 4931c108451..61ebfa9c68c 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -739,7 +739,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(_("%s, %s and %s are mutually exclusive"), "--gui", "--tool", "--extcmd"); if (use_gui_tool) setenv("GIT_MERGETOOL_GUI", "true", 1); diff --git a/builtin/log.c b/builtin/log.c index a2005e3c778..c39b974ea37 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1964,7 +1964,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(_("%s, %s and %s are mutually exclusive"), "--stdout", "--output", "--output-directory"); if (use_stdout) { setup_pager(); diff --git a/builtin/worktree.c b/builtin/worktree.c index 9287c455594..73ee505234c 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -504,7 +504,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(_("%s, %s and %s are mutually exclusive"), "-b", "-B", "--detach"); if (lock_reason && !keep_locked) die(_("--reason requires --lock")); if (lock_reason) diff --git a/diff.c b/diff.c index 861282db1c3..342e53f1c1f 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(_("%s, %s and %s are mutually exclusive"), "-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")); From patchwork Fri Dec 3 07:01:42 2021 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: 12654409 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 5A503C433FE for ; Fri, 3 Dec 2021 07:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378781AbhLCHFZ (ORCPT ); Fri, 3 Dec 2021 02:05:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378755AbhLCHFU (ORCPT ); Fri, 3 Dec 2021 02:05:20 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7212EC061759 for ; Thu, 2 Dec 2021 23:01:56 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id j3so3718732wrp.1 for ; Thu, 02 Dec 2021 23:01:56 -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=enOe15eSMg6JX5SgjnrRCkB3LSYBx2v2eUJQC0Qr678=; b=WO04sDRWg7mwCvTQrA3jTEFLlFEHS6bwbx0sSmURA+4L3Ymb8UlFz6Eje6SmD1hnKP /FtDjYPueYmaxOnWJP2CiKN7K5UWbvoZpfjnnqmkQpV1kILY+f60y6vPvhvnNMcjYvez kI+6Pd2SQXb5OFmHSxJ8HgPkw6oJfPaXzps+iBTx/idR6k3+qvEvi8KYhURXt1OH1+4N +BGosCK5CNMJWMlf405PIBKWXeJjDnmxFQPsDwoJXOiNThZTRGxOAxBfD563AubUR2td 9BuXwR733PmgWWtXMD5wJVD7CbF00xQqc535Aled7w/6dcOuyq2MDrC4fh7bEpjN2oWp B91A== 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=enOe15eSMg6JX5SgjnrRCkB3LSYBx2v2eUJQC0Qr678=; b=Cv1Uz6fHWpPqLc3hYbTzAdU4rqPM9HFcEI5zF05kk5GS3F9Z7ytuC0GV1SLWkFkUYV OnPuW+8+7DclyzVLWbM+HH+wlm/6hYddRoLLubI5J9f8sr1qeeWn22S17ex0sp2lId2z wRL5ckEbnuqFMzqtZaPNw53n2nrfNt33hhp9L/gvkxOuRmdj6v3Awf5kjtiEjNftWM0u K/rZMjGiNjvkSE6mEx5WpWfB4KM6MwUnKXh4HMr112s3kNHToHnzvVsDXBt73IPhHuPz ItMu0R8h2E8LAdlNQV8yRKnpyQpcYunTOG3GDjp0LyrhxnBoRw/EShBeNnGr7eRe8wJK A/cg== X-Gm-Message-State: AOAM530FUpCIEeDV9cMtYQftHxuLFPhe1tE8k6t6MnW9SrJN4dhgr/nj wtddiprRIDSMjLioW/cGv6bxDcoj5V0= X-Google-Smtp-Source: ABdhPJwFuIfXeuC+31rSCHmnbkE6ZSjpohsPbTD54TqHyUwu3DgnIgY1+YQZBcwl9ZEjRch1ansg7w== X-Received: by 2002:a05:6000:154b:: with SMTP id 11mr19909347wry.394.1638514914656; Thu, 02 Dec 2021 23:01:54 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m36sm1784095wms.25.2021.12.02.23.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:54 -0800 (PST) Message-Id: <46e94ef3ac9378f934cd4e2bd00e390978fda05a.1638514910.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:42 +0000 Subject: [PATCH 03/10] i18n: turn "options are incompatible" into "are mutually exclusive" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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 | 4 ++-- builtin/clone.c | 2 +- builtin/commit.c | 4 ++-- builtin/describe.c | 2 +- builtin/difftool.c | 2 +- builtin/fast-export.c | 2 +- builtin/index-pack.c | 2 +- builtin/pack-objects.c | 2 +- builtin/push.c | 8 ++++---- builtin/repack.c | 4 ++-- builtin/reset.c | 4 ++-- builtin/stash.c | 2 +- builtin/tag.c | 2 +- revision.c | 22 +++++++++++----------- t/t2026-checkout-pathspec-file.sh | 4 ++-- t/t2072-restore-pathspec-file.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 | 4 ++-- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/apply.c b/apply.c index 43a0aebf4ee..fefec23f1ec 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(_("%s and %s are mutually exclusive"),"--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..10376be7161 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(_("%s and %s are mutually exclusive"), "--add-file", "--remote"); if (!base) base = ""; diff --git a/builtin/add.c b/builtin/add.c index ef6b619c45e..de1547b3dcd 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -510,9 +510,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(_("%s and %s are mutually exclusive"), "--dry-run", "--interactive/--patch"); if (pathspec_from_file) - die(_("--pathspec-from-file is incompatible with --interactive/--patch")); + die(_("%s and %s are mutually exclusive"), "--pathspec-from-file", "--interactive/--patch"); exit(interactive_add(argv + 1, prefix, patch_interactive)); } if (legacy_stash_p) { @@ -529,7 +529,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(_("%s and %s are mutually exclusive"), "--pathspec-from-file", "--edit"); return(edit_patch(argc, argv, prefix)); } argc--; @@ -541,7 +541,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(_("%s and %s are mutually exclusive"), "-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 7a1d1eeb070..50d99fa6fd4 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -717,7 +717,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(_("%s and %s are mutually exclusive"), "--column", "--verbose"); colopts = 0; } diff --git a/builtin/checkout.c b/builtin/checkout.c index 4bd8a57f190..ca444e9c177 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1731,10 +1731,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(_("%s and %s are mutually exclusive"), "--pathspec-from-file", "--detach"); if (opts->patch_mode) - die(_("--pathspec-from-file is incompatible with --patch")); + die(_("%s and %s are mutually exclusive"), "--pathspec-from-file", "--patch"); parse_pathspec_file(&opts->pathspec, 0, 0, diff --git a/builtin/clone.c b/builtin/clone.c index fb377b27657..b8c3f072bae 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(_("%s and %s are mutually exclusive"), "--bare", "--separate-git-dir"); option_no_checkout = 1; } diff --git a/builtin/commit.c b/builtin/commit.c index 883c16256c8..cb7b9a38daa 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -355,7 +355,7 @@ 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(_("%s and %s are mutually exclusive"), "--pathspec-from-file", "--interactive/--patch"); if (all) die(_("--pathspec-from-file with -a does not make sense")); @@ -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(_("%s and %s are mutually exclusive"), "--long", "-z"); } if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED) diff --git a/builtin/describe.c b/builtin/describe.c index e912ba50d7b..26da61a216f 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(_("%s and %s are mutually exclusive"), "--long", "--abbrev=0"); if (contains) { struct string_list_item *item; diff --git a/builtin/difftool.c b/builtin/difftool.c index 61ebfa9c68c..ab8f06c991d 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -736,7 +736,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(_("%s and %s are mutually exclusive"), "--dir-diff", "--no-index"); if (use_gui_tool + !!difftool_cmd + !!extcmd > 1) die(_("%s, %s and %s are mutually exclusive"), "--gui", "--tool", "--extcmd"); diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 8e2caf72819..31157e966d6 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(_("%s and %s are mutually exclusive"), "--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..f9b40349f41 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(_("%s and %s are mutually exclusive"), "--object-format", "--stdin"); if (!index_name && pack_name) index_name = derive_filename(pack_name, "pack", "idx", &index_name_buf); diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 1a3dd445f83..a5e674894f0 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(_("%s and %s are mutually exclusive"), "--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..ba55e07a678 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(_("%s and %s are mutually exclusive"), "--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(_("%s and %s are mutually exclusive"), "--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(_("%s and %s are mutually exclusive"), "--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(_("%s and %s are mutually exclusive"), "--all", "--mirror"); if (!is_empty_cas(&cas) && (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES)) cas.use_force_if_includes = 1; diff --git a/builtin/repack.c b/builtin/repack.c index 0b2d1e5d82b..8e92943f871 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -679,7 +679,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(_("%s and %s are mutually exclusive"), "--keep-unreachable", "-A"); if (write_bitmaps < 0) { if (!write_midx && @@ -710,7 +710,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(_("%s and %s are mutually exclusive"),"--geometric", "-A/-a"); init_pack_geometry(&geometry); split_pack_geometry(geometry, geometric_factor); } diff --git a/builtin/reset.c b/builtin/reset.c index 73935953494..6e80e5c5a51 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -328,7 +328,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(_("%s and %s are mutually exclusive"), "--pathspec-from-file", "--patch"); if (pathspec.nr) die(_("--pathspec-from-file is incompatible with pathspec arguments")); @@ -364,7 +364,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(_("%s and %s are mutually exclusive"), "--patch", "--{hard,mixed,soft}"); trace2_cmd_mode("patch-interactive"); return run_add_interactive(rev, "--patch=reset", &pathspec); } diff --git a/builtin/stash.c b/builtin/stash.c index a0ccc8654df..080572cc608 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1644,7 +1644,7 @@ 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(_("%s and %s are mutually exclusive"), "--pathspec-from-file", "--patch"); if (ps.nr) die(_("--pathspec-from-file is incompatible with pathspec arguments")); diff --git a/builtin/tag.c b/builtin/tag.c index 6fe646710d6..41941d5129f 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(_("%s and %s are mutually exclusive"), "--column", "-n"); colopts = 0; } if (!sorting) diff --git a/revision.c b/revision.c index 1981a0859f0..58a1a0e66c6 100644 --- a/revision.c +++ b/revision.c @@ -2295,11 +2295,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(_("%s and %s are mutually exclusive"), "--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(_("%s and %s are mutually exclusive"), "--cherry", "--left-only"); revs->cherry_mark = 1; revs->right_only = 1; revs->max_parents = 1; @@ -2308,12 +2308,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(_("%s and %s are mutually exclusive"), "--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(_("%s and %s are mutually exclusive"), "--cherry-pick", "--cherry-mark"); revs->cherry_pick = 1; revs->limited = 1; } else if (!strcmp(arg, "--objects")) { @@ -2519,7 +2519,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(_("%s and %s are mutually exclusive"), "--show-linear-break", "--graph"); return 1; } @@ -2862,24 +2862,24 @@ 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(_("%s and %s are mutually exclusive"), "--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(_("%s and %s are mutually exclusive"), "--parents", "--children"); /* * Limitations on the graph functionality */ if (revs->reverse && revs->graph) - die("cannot combine --reverse with --graph"); + die(_("%s and %s are mutually exclusive"), "--reverse", "--graph"); if (revs->reflog_info && revs->graph) - die("cannot combine --walk-reflogs with --graph"); + die(_("%s and %s are mutually exclusive"), "--walk-reflogs", "--graph"); if (revs->no_walk && revs->graph) - die("cannot combine --no-walk with --graph"); + die(_("%s and %s are mutually exclusive"), "--no-walk", "--graph"); if (!revs->reflog_info && revs->grep_filter.use_reflog_filter) - die("cannot use --grep-reflog without --walk-reflogs"); + die(_("%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 43d31d79485..88e00203df6 100755 --- a/t/t2026-checkout-pathspec-file.sh +++ b/t/t2026-checkout-pathspec-file.sh @@ -148,10 +148,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 "--pathspec-from-file and --detach are mutually exclusive" 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 "--pathspec-from-file and --patch are mutually exclusive" 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..2e918daa225 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 "--pathspec-from-file and --patch are mutually exclusive" 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/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh index 9e35c1fbca6..4e5cdabc97f 100755 --- a/t/t3704-add-pathspec-file.sh +++ b/t/t3704-add-pathspec-file.sh @@ -137,13 +137,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 "--pathspec-from-file and --interactive/--patch are mutually exclusive" 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 "--pathspec-from-file and --interactive/--patch are mutually exclusive" 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 "--pathspec-from-file and --edit are mutually exclusive" 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..b7e6c89682b 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 "--pathspec-from-file and --patch are mutually exclusive" 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..dec92ff0a75 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 "--bare and --separate-git-dir are mutually exclusive" err ' diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh index 15ccb14f7e2..b8a3e2e2a9d 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 "--pathspec-from-file and --patch are mutually exclusive" 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 5fbe47ebcd0..8ef1c8d941c 100755 --- a/t/t7526-commit-pathspec-file.sh +++ b/t/t7526-commit-pathspec-file.sh @@ -140,10 +140,10 @@ 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 "--pathspec-from-file and --interactive/--patch are mutually exclusive" 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 "--pathspec-from-file and --interactive/--patch are mutually exclusive" 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 && From patchwork Fri Dec 3 07:01:43 2021 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: 12654403 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 05736C433FE for ; Fri, 3 Dec 2021 07:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378766AbhLCHFX (ORCPT ); Fri, 3 Dec 2021 02:05:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378758AbhLCHFU (ORCPT ); Fri, 3 Dec 2021 02:05:20 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09494C061757 for ; Thu, 2 Dec 2021 23:01:57 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id d9so3679234wrw.4 for ; Thu, 02 Dec 2021 23:01:56 -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=3NIj3RGET4+cxqJiOuqdUckWmvKtMttcb0xrR2p7udo=; b=dhHhJZCpkbDyD90lNxtcjeAbHIV6BCKJxMVuJl6IpHCyh32Nh9XuoJk1DX8WGQ7VqH z0YU1hzWPoKHgdmoAU4aiUQ+0vstoCq1k553u4u223alLLHFhmP2PULBR6NslNz2yXST ImIrcfgGNzR3FlPjn8SWMc5tRztEdd1QQZ4oov0iNTCjgbntwRn4uMlEojP/qDXvkliR h8CfNtkYcB4tqSPU+2h+2/pMdMVCKVzIldDrRvQ9dEgrXB6V5DTudacSdj5FAOwADmz+ Psg1xf2AkhqO9tzZ0Pu7rqXF6jQkVOEjAXd86QTCC4/tvdDTtJbyeJtFtiAT3Xh/alkw 7YJg== 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=3NIj3RGET4+cxqJiOuqdUckWmvKtMttcb0xrR2p7udo=; b=jy2ktxe/0HUAn97e2Q+GTqDPtC8fOELa5CAV1A392OBP0DQ/s18nFjJeFSYRPXYF5m pm3Gp3/guYaNc+UOcPaOUCj/B7wAo7CW43SLxiu/gh5Jjd+qchhH4RDzxVB+IkzvhFjF biW/7I4ZJ73fSUtHjGB5DpUOwcmSQuui8m0rcH3RhvTV8yBSwfR1X8AK13dNioce2vyz 3uDlWob9w+6QjKX3we09M3Bjv29IfxQX1QXd+cjmsHlOY+xEZelEYJTPEpnG6Jd0rWhk htTieI2Mceu+JraR28FHgFH7oj9S8xDAa83Ezlvf/9iACvldK0nnMLskXsqVCWcM8l7z LgEQ== X-Gm-Message-State: AOAM531WxGIrbv7pT9vPG94LHQjPavcU3Ni0rIff104+m1FMOMjRdT+u e1mbwCJ8wweo5ywVEXXcjYb+Bia1j7U= X-Google-Smtp-Source: ABdhPJzZVrncVDeQpkvk8tIG4bbzFGV2EKhKqfwsgGevpDtUbQL5mD/o1cwVOzfXD32RW0rT7ReNhg== X-Received: by 2002:a5d:4b45:: with SMTP id w5mr19788144wrs.272.1638514915486; Thu, 02 Dec 2021 23:01:55 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m36sm1784132wms.25.2021.12.02.23.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:55 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:43 +0000 Subject: [PATCH 04/10] i18n: standardize "cannot open" and "cannot read" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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 10376be7161..f1208beacff 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 bec3cc7535e..b0d63149388 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -995,7 +995,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; @@ -1405,7 +1405,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 Fri Dec 3 07:01:44 2021 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: 12654407 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 7975CC433EF for ; Fri, 3 Dec 2021 07:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378782AbhLCHF1 (ORCPT ); Fri, 3 Dec 2021 02:05:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345605AbhLCHFV (ORCPT ); Fri, 3 Dec 2021 02:05:21 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E28EFC061758 for ; Thu, 2 Dec 2021 23:01:57 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id v11so3595131wrw.10 for ; Thu, 02 Dec 2021 23:01:57 -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=c89bfBqhcMAtaDKa0oO8DyoNZoow0uUdaCmjsxYmqGE=; b=YOsWLSh7P+Iz80+f72KUka4okSIYRZl7qmj2RYK51xaMMtyV6Z2o/3O43vBRxl8IwG UMLI/ZBNgKmkTibNvUMYWGV5o+ckqvL3ol27UzotwV5/gNaw4U9rfE/sWcYmKg8aFm47 QkJ0aNh/yuh8tVFjp6qluWu8Gno03G3pgh2Ro++zQ22KYPs5YlHHYQ0Qflu3IDJXB19N y7UrlVXmjr1VVs7R0W+JJ3kzof2yIl6THgU/PCTZGBM/vnIEJHetnzkETgfmGgrKatFr 6jF7wXSsO3r+1qcVam963pG+bXR9DIPNghENpNqDFxd3j88lxCz35b869MYzvY7D2EXx b50A== 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=c89bfBqhcMAtaDKa0oO8DyoNZoow0uUdaCmjsxYmqGE=; b=Wv+thoOST2ivhHvzuSFb3KSPuYfZ6saopBlZRBK7ZVGBZPOv51NaYuEdO3yIp+gm3/ z/Wne2PWg+uRBFMzu4J/+gePS+lzzngTjijvpmRQFPT/Ag6u8JeCeFiNSd6Y/TyzbA4R xIxUEGsSx7UEv1023pFuio/0pG7YSgsMnNHwlZP8WwO8VVAwzkvILVz/EMxrmIOCeNjV AM5jwGthKstkXDqvizPEBDKu4HtHePfIAWeLQrAJWMph5mRsglBjbGqMaFQFIOj9VBWX dqPSGtpBAJlM1VCgCB7wvQ8ZuYMarkQPi7HiuCq2zMjIXIg9JB2Dsc7jQ5Ir9Lx/fG8M Z7Xw== X-Gm-Message-State: AOAM530qCajsN0UBVqOdaCAbGPIPUP07LUSeZDwdqo+XfVCikQVgr7GJ dfTIM8cJW8/8v9lznaNvCsB47N2wjq4= X-Google-Smtp-Source: ABdhPJwV1h8MTrItBn1jmOvdddd+ryTjT7rF57+y/XSsIGd1B8E+/AFYyEueMrwat6HucY/iHGPA9Q== X-Received: by 2002:a5d:64a2:: with SMTP id m2mr20287194wrp.248.1638514916373; Thu, 02 Dec 2021 23:01:56 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id c1sm1800137wrt.14.2021.12.02.23.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:55 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:44 +0000 Subject: [PATCH 05/10] i18n: tag.c factorize i18n strings MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index 41941d5129f..6415d6c81a2 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -543,13 +543,13 @@ 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")); + die(_("%s option is only allowed in list mode"), "-n"); if (filter.with_commit) - die(_("--contains option is only allowed in list mode")); + die(_("%s option is only allowed in list mode"), "--contains"); if (filter.no_commit) - die(_("--no-contains option is only allowed in list mode")); + die(_("%s option is only allowed in list mode"), "--no-contains"); if (filter.points_at.nr) - die(_("--points-at option is only allowed in list mode")); + die(_("%s option is only allowed in list mode"), "--points-at"); if (filter.reachable_from || filter.unreachable_from) die(_("--merged and --no-merged options are only allowed in list mode")); if (cmdmode == 'd') { From patchwork Fri Dec 3 07:01:45 2021 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: 12654411 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 47DA6C433F5 for ; Fri, 3 Dec 2021 07:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378786AbhLCHF2 (ORCPT ); Fri, 3 Dec 2021 02:05:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378763AbhLCHFW (ORCPT ); Fri, 3 Dec 2021 02:05:22 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D69A9C06174A for ; Thu, 2 Dec 2021 23:01:58 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id az34-20020a05600c602200b0033bf8662572so1513202wmb.0 for ; Thu, 02 Dec 2021 23:01:58 -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=BGoEwpce2lzk+PLRj6EJqf03Okj4XJrZer+phNrz7pw=; b=NbGz+ArNiTEDcc2F+QKdY6Jmfz07ER2k20m8w9v6B3rzDVfMw3iGtu60FJzUMABxKf 7wChLfdA3ay0ZJPUiG0d8zLmNB+YtJ+5V1/pwB8OjLPDKDl/Qss/elqya3bjipn7JObd c5AnM+EHiVzOtD0aQWiwhBVA4UtVm0IP0NO9EGnvzie2L0E7B+82TcrYEnt04Vc/blLR QyvnBCtTjEipmDsPbratIs3ULDS80bXTPPY94VsrKnCeo3d41rTSaH/Xbx6Y2Vl9NMt1 YiAY37h0m8ROs7ZLqUpoDx7zlULrKaj7JKOolPU/gqGhPcSS9VocXhV1xIL1BXO505ab DN5w== 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=BGoEwpce2lzk+PLRj6EJqf03Okj4XJrZer+phNrz7pw=; b=HXm7Kb5BEkFl9EriX0HD8pmX34CCX67fZ6LwAbQWla19ZpJI4/L4C3vvCQH3AhLF2P 2eyZEnp02gJ1UfXx/vL3siSC66pjSgS/12I9d0+f0sIWkogjgAGkQViYurtkcR0Zji5j BZQtAp/Z/hQq+sS5EVCNeboaGu5MJv/BT7lsYtZ0gN/WStCSDaDtsE+N/gIWDaOeAfBF sOJZTu+zzxwMvkbf511rQ1f0d1sDhOemw67WyutLHnnsZav7bwz0ktkMSC6n9feYJrri 6lwu1sQswdj6VmHU+EPLcqt5urFUASjr0T+3hWrjhAwjch7qHz+Pexzw9f69VSGbmcPj T+hA== X-Gm-Message-State: AOAM531gc12AG193EV6/g4fIbtZ/wIreXpsijw2QwSAesvdRak/nHfMc WjA3hXM8WrlhTAoG9BnnBUSfR6SV8Kc= X-Google-Smtp-Source: ABdhPJxN76G5p4TD8hgV/lXYzR2WvJH3DihXsDdniZ5TiYrx+g1anO8JRTVqy2PyHx+or6tmynHoXA== X-Received: by 2002:a1c:1c1:: with SMTP id 184mr12746780wmb.1.1638514917159; Thu, 02 Dec 2021 23:01:57 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id h16sm1919594wrm.27.2021.12.02.23.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:56 -0800 (PST) Message-Id: <653e33f799531ccdc21212238c2f404ccf9e970c.1638514910.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:45 +0000 Subject: [PATCH 06/10] i18n: factorize "--foo requires --bar" and the like MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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 | 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 ++-- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/archive.c b/archive.c index f1208beacff..0d96217b4d4 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(_("%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 de1547b3dcd..1be22f8c287 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -544,7 +544,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) die(_("%s and %s are mutually exclusive"), "-A", "-u"); if (!show_only && ignore_missing) - die(_("Option --ignore-missing can only be used together with --dry-run")); + die(_("%s requires %s"), "--ignore-missing", "--dry-run"); if (chmod_arg && ((chmod_arg[0] != '-' && chmod_arg[0] != '+') || chmod_arg[1] != 'x' || chmod_arg[2])) @@ -576,7 +576,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(_("%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 ca444e9c177..825e753f607 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1740,7 +1740,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(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file"); } opts->pathspec.recursive = 1; diff --git a/builtin/commit.c b/builtin/commit.c index cb7b9a38daa..37e8cf09bd5 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(_("%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 31157e966d6..b0302a75374 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(_("%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 f9b40349f41..ed16230fa99 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(_("%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 c39b974ea37..ea54576f38b 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -2097,7 +2097,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(_("%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 6e80e5c5a51..7efa95e0529 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -337,7 +337,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(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file"); } unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid); @@ -395,7 +395,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(_("%s requires %s"), "-N", "--mixed"); /* Soft reset does not touch the index file nor the working tree * at all, but requires them in a good order. Other resets reset diff --git a/builtin/rm.c b/builtin/rm.c index 3d0967cdc11..38ac3c71252 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(_("%s requires %s"), "--pathspec-file-nul", "--pathspec-from-file"); } if (!pathspec.nr) diff --git a/builtin/stash.c b/builtin/stash.c index 080572cc608..84a0a4667e6 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1653,7 +1653,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(_("%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 73ee505234c..c6d64dc8dfa 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -506,7 +506,7 @@ static int add(int ac, const char **av, const char *prefix) if (!!opts.detach + !!new_branch + !!new_branch_force > 1) die(_("%s, %s and %s are mutually exclusive"), "-b", "-B", "--detach"); if (lock_reason && !keep_locked) - die(_("--reason requires --lock")); + die(_("%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 a9604f35a3e..0bdef8877c1 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -296,7 +296,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(_("%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 fa642462a9e..68cbfc1979d 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -131,7 +131,7 @@ int cmd_main(int argc, const char **argv) if (packfile) { if (!index_pack_args.nr) - die(_("--packfile requires --index-pack-args")); + die(_("%s requires %s"), "--packfile", "--index-pack-args"); fetch_single_packfile(&packfile_hash, argv[arg], index_pack_args.v); @@ -140,7 +140,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(_("%s requires %s"), "--index-pack-args", "--packfile"); if (commits_on_stdin) { commits = walker_targets_stdin(&commit_id, &write_ref); From patchwork Fri Dec 3 07:01:46 2021 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: 12654415 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 84E71C433FE for ; Fri, 3 Dec 2021 07:02:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378791AbhLCHF2 (ORCPT ); Fri, 3 Dec 2021 02:05:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378765AbhLCHFX (ORCPT ); Fri, 3 Dec 2021 02:05:23 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F0D9C061757 for ; Thu, 2 Dec 2021 23:01:59 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id c4so3624923wrd.9 for ; Thu, 02 Dec 2021 23:01:59 -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=FRIu9ENK5TNQ1VitLq87DV6Jzcm3JFMqG+yx+KfTc0Y=; b=AI3CDPlVAisD+8JdN+MDyoygab0HP/ZI0/XE47W/oAqepP958Lc60VMLhpAUAPYKWS 0P0v9276GYRbeYWkVwRE3HOBx+R96QCXrm0Be6V0yjf/iJFEgJhGIUJAl6ZVOyD8Ic0W k8yC3dlL9qgYZir2O7P3sUWNuXxVWgJvVyA00KiELjw6en82sEAbJt+nh4KcrUMEc5uP TsXKZEa60PokQKc0DtAsmc4ZvpTFFUaaaCCAZrc4xtz4MKnFUIWbXoy+Sb8Xr0NvM6uI 0S/clC4E/28gU0pHs41bAL33Q29Pg2sPvwDczRiK2nQ0YJTCE3eXYPyq4X7SGwDSuF/h D26g== 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=FRIu9ENK5TNQ1VitLq87DV6Jzcm3JFMqG+yx+KfTc0Y=; b=vFo7WUM41Q5OQpNgwom9Uqh7rp7j4gDfSLM+2Mg5bjqQa1SbVqCoaXP8R8U3CoWuDU naJFowG3TPYNiXvuiX2KKi2CkMmI3Hjdv8KdkxDQam4hzmTciMLYLzz/VPjYgDLHbTHj rVeiaGkX+tIdO+3gdCivmxGw45lKLj2PBVHKt4YUT94TXM3Oq3FueFYKTFvTOGrbk5H/ qGl4694OT3704p7Mxbdn+k9H0IfdZjrGkM5VeWnH43rfFmTSZjabcGJiNeMoMg+aPF1s RnfHN5kgpVe3VtUor2nfNk36JgWeXTjnNdUZOV5yPwbnC3f9g8s8rDFk2ihHxEXZxPtg KVvA== X-Gm-Message-State: AOAM531lVVXeBcC8bYR5EbBP5stMQvLLuykXEDMMI9jBLDxcC1b0VUR9 g/6qmLsYtnAGtc1kHCmu6LizTJGhHHA= X-Google-Smtp-Source: ABdhPJzwhSqb9s/Jl8AYjrHqDM3yv14pfEQ/n6ByVYJzI+n997SZHQbWdj4h2t880T9iIZAOUqcegQ== X-Received: by 2002:a5d:64ea:: with SMTP id g10mr20096608wri.242.1638514917961; Thu, 02 Dec 2021 23:01:57 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m1sm1727525wme.39.2021.12.02.23.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:57 -0800 (PST) Message-Id: <4b0e1ff29cb2cb8ad934997ea0502cb22df5532b.1638514910.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:46 +0000 Subject: [PATCH 07/10] i18n: factorize "no directory given for --foo" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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 5ff21be21f3..8624730f022 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\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\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\n" ), "-C"); usage(git_usage_string); } if ((*argv)[1][0]) { From patchwork Fri Dec 3 07:01:47 2021 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: 12654413 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 EFE62C433EF for ; Fri, 3 Dec 2021 07:02:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351061AbhLCHFa (ORCPT ); Fri, 3 Dec 2021 02:05:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378758AbhLCHFX (ORCPT ); Fri, 3 Dec 2021 02:05:23 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D749C061757 for ; Thu, 2 Dec 2021 23:02:00 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id d9so3679478wrw.4 for ; Thu, 02 Dec 2021 23:02:00 -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=USO2JAKJqpOPHL0exB2jcq1EPX6zp2qgL3t7hvXh6d8=; b=GVE3i8JHfGkZhuTOsKEkZfYH2eUvojBbwSGCmNM38LPQSOm087o5XrLokxhmdKzXEk afuk/d3q9N+gw5+zHz8JtC1z3ep6+q55CDHLIYbNXG479RnfNFpOxrL8QF8T7qtPg6/j AHKXzHgYXTYM0gNJkLg0QB1rIIrCpIOrmsxRZR6KAPumhtTXDaictJANXtNYHgVZ0nzq QJbRfm2d4tWG3sfbuQ8s6Qyd9F17mHfofQmCUi4X4EZpSk3asjEtOJnKeMxQ8tHG5fok MiB3cQEtro2+JryctJV8dwSRZMWd1E9BnHHbHUMsroN9TcQHyAQKvqwahR62HJQ1gVmu pcbQ== 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=USO2JAKJqpOPHL0exB2jcq1EPX6zp2qgL3t7hvXh6d8=; b=0jgbYhsZQVHu748KJJbxniFhIi+sAPV609vYjPbirI5BPLv5cR0ghpc+lQuWmAeWJq 4qL4JoDHIOH/7enzfq97aqUlRa+v6O3d8MUJoaXlDOAk5lq5xuDuD7PpKFUrgYgNpZa6 k5lrm6D6XyDACXW8880au0zTjuzoq9zzuIL4n8xb/JV+CrWz4mzr1d2c5D+eBDK8ZFzV DjftM86Y4l3mBzjEepWGdTYzrunDtkhRVDa96nT+57nxBtL/orjUU1H1mcCji4afj/ad OLMXxtqsa6xsy3EwSW6NrLms79OdLz8dHPKLRndO3q9XtRoH4U2wFsDLL6WnJrcxGC39 PndQ== X-Gm-Message-State: AOAM532Sf5peStVTTMusndmMpE3vQ/ImpXSLei9FwXmiIeitqvuR+VRh l033qBO0qApRltEOt7vO/62DUJeo9cI= X-Google-Smtp-Source: ABdhPJyxSxFJOrAmnoAeMpySbvBSzpMEIdDWp/Js//qtqQ6Wl3LlkozJ1lnwKU5iGR1rrerk7DV1Mg== X-Received: by 2002:a5d:4343:: with SMTP id u3mr20070622wrr.450.1638514918860; Thu, 02 Dec 2021 23:01:58 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id v6sm4245407wmh.8.2021.12.02.23.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:58 -0800 (PST) Message-Id: <4c2df4522a10163946d3d63821dcceffb4a312bc.1638514910.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:47 +0000 Subject: [PATCH 08/10] i18n: refactor "unrecognized %(foo) argument" strings MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 08a3f839c97..554c2ba1b17 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; } @@ -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 Fri Dec 3 07:01:48 2021 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: 12654417 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 C2378C433F5 for ; Fri, 3 Dec 2021 07:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378799AbhLCHFb (ORCPT ); Fri, 3 Dec 2021 02:05:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378750AbhLCHFY (ORCPT ); Fri, 3 Dec 2021 02:05:24 -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 1C453C061757 for ; Thu, 2 Dec 2021 23:02:01 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id i12so1530058wmq.4 for ; Thu, 02 Dec 2021 23:02:01 -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=XZyz9Qqvb+s7RBAh8LCpOU5OHAyNYHhDzL+R9o/OFeE=; b=OOFB+eztlRQNl4ILBYZ2p4Qq56enqCg+Vz1SN1/NGCByIk2U5y7H/i682edViE9+yP NFtC+Kl6v+SK4NJMZHEUFkIq3OgnX0y7c865EpcgLX6nMpklvT56bvXmM+229YDbPtKI /V5TSh5D+fQF5+z4ro82AuqRttznyi1dfC2KcutjfbA+u6W+rUjimgUQm4l81s/+/PaO k8QjSID1W2tURLG6ul0yAHpWgIDiClcZ57wHAomifZtwkY1Ruifxsgm3UmW9VkeJi3cP 4ez/gOpUV1TFoQuypk0CUjLKAgtSdp0rswTAaN55RYfQ41H4GOAsQb6KuDBmkQ0iMvDQ ejtQ== 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=XZyz9Qqvb+s7RBAh8LCpOU5OHAyNYHhDzL+R9o/OFeE=; b=y+2gpR/Ly9J7zkW7I85+tKK4Fq6ln25RVFQQ9E/Dbn4T0pkHY2FGM2WBHTB7i4Gbqu AatV12ZQkSSwSEwkd/5DmeovFrvahhDoczYd2Bhhu2HqDMrwWBtI5EIxY8ATjpBWnews zWqF29HQPeqE6hCvJ4Arz+A4ZLpTxIfVhgSb6qTQL39NzW31TjgR3rkiQTCeNoto2y6r 4P+CL+8WxIWHxJEm/C5oBqtKL3+5DwXkniJJPszUJGY/VNdLfJ+RTxg8MDG8rfFCH7Ay tuLpczXEPdiyqEZNcNjTIKVB1C5AFgUFLNh6EPe+3NSxyny5mRnllEHXu3E+ob4nU3lD 80mQ== X-Gm-Message-State: AOAM531QRizztpiLvlK1uguj5j97uwyzTMTpdeUqlWqWGZam9Xgy8oKB jsJXlyn569PeH5mUyhLK1mXBnXH+pjc= X-Google-Smtp-Source: ABdhPJwz6Iz9YlJLAe2KrV1DRbxlF7Sb1X2G0HDiIlPo9yct0MnJErY9a/1aIH9PmxmsMObIH8eYvA== X-Received: by 2002:a1c:98ca:: with SMTP id a193mr12991762wme.162.1638514919504; Thu, 02 Dec 2021 23:01:59 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t127sm4262449wma.9.2021.12.02.23.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:59 -0800 (PST) Message-Id: <6196bccf086251a390c039b18b4f88fdb9e59dea.1638514910.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:48 +0000 Subject: [PATCH 09/10] i18n: factorize "--foo outside a repository" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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 fefec23f1ec..13b9abafe9d 100644 --- a/apply.c +++ b/apply.c @@ -136,7 +136,7 @@ int check_apply_state(struct apply_state *state, int force_apply) return error(_("%s and %s are mutually exclusive"),"--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 Fri Dec 3 07:01:49 2021 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: 12654419 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 4ADD9C433F5 for ; Fri, 3 Dec 2021 07:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345605AbhLCHFe (ORCPT ); Fri, 3 Dec 2021 02:05:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378774AbhLCHF1 (ORCPT ); Fri, 3 Dec 2021 02:05:27 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A544C061759 for ; Thu, 2 Dec 2021 23:02:02 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id d9so3679558wrw.4 for ; Thu, 02 Dec 2021 23:02:02 -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=Cc1qSmhkRH9mEiAkeWW//bHs4MCli1Fze6wkuo2IMdo=; b=lptudOfEMMWUWgFI0WPp38z7AK404xDWwssH5b1xitdustZb+NjDSJ0rr1g8T7d+MZ LsVOvDWtBU0kTgRDK5kxI0FC2L2JTQ/xP4qPesCM69jB+oenAksghlPTjceseHed1vrJ uifxHe1vd1KXNeakymrP4+YH4ekXlqjj5oXGiE/+0DXoBF6lF3P8Gj6oalnRjEPBrjf2 c0e7hBB9emyShoyHFmK2M8+Bmj8Oa+fNA/9r7tUSmlMFuL6haN/AIf6FNKgZCXpW9f7P A1YsNQlsrWk+3PUSWJVaaFegczxr6MkrCCqtxDhl0WB84mbi8IonsN6O5H2Po88bkCQ0 ANSw== 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=Cc1qSmhkRH9mEiAkeWW//bHs4MCli1Fze6wkuo2IMdo=; b=Y2j6Ptc1kewDyAAQnwyaEjx+vyAsRcIEFwkiCAhQuGwk+jtV+jAu7cpyK+A+uSKB1k SRfn9kYNbuKDa4Udptzy6MNvAFSb20DZ1Z0jyaFAp8cps/szQvUNiRFLH+tkcilkfdcy xqr87OYDzSUOVThf75x6aHXK7/g+YruqLGAhumK3nvf8MtlqE/uxXxjv4zm+edQWXNhQ +jGoauimv7/q3vAC7+eNcKQ10n4CbFN2uYGwJEI3hx6v+NAkrDIczuJUJfiin0J0a6MH VW7KAWMM5wCyoS3UTXRiXZ4KgU9ni5nVN4rFGmmY4LVJ+C+6KDk8A0mKYMl1m8n12Y88 iJ+g== X-Gm-Message-State: AOAM532xHQjVPeO7RTpnOHy62Sl8EbQ8s0LJLBZFd3aBWrA9yyqIZy13 MDBpok6x6m3Sr/KiiS4fy6i4gCFj/lQ= X-Google-Smtp-Source: ABdhPJytvSolvSXM5JwfU4e2wRwuEWkrQNshuKXKR+GjnMVXZG1qzLPg6EBliIukL58/w8KR9XqhnQ== X-Received: by 2002:a05:6000:547:: with SMTP id b7mr19772044wrf.543.1638514920175; Thu, 02 Dec 2021 23:02:00 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id h13sm1856984wrx.82.2021.12.02.23.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 23:01:59 -0800 (PST) Message-Id: <7d97cbe7e9a9c55048f4db646626598774e6d92e.1638514910.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 03 Dec 2021 07:01:49 +0000 Subject: [PATCH 10/10] i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: =?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 554c2ba1b17..b515efeaa25 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;