git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: "Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Johannes Sixt" <j6t@kdbg.org>,
	"Jean-Noël Avila" <jn.avila@free.fr>
Subject: Re: [PATCH v2 6/6] i18n: factorize "bad argument" messages
Date: Sun, 03 Apr 2022 16:41:39 +0200	[thread overview]
Message-ID: <220403.86o81ikywa.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <febe64a8a069dd81523c33a93cfea9553e40c283.1648915853.git.gitgitgadget@gmail.com>


On Sat, Apr 02 2022, Jean-Noël Avila via GitGitGadget wrote:

> From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>
>
> We also quote the placeholders as they replace constant strings.

I don't think this change is good in that it takes two different cases
we cared about distinguishing before, and squashes them into one. I.e.:

> +++ b/builtin/bisect--helper.c
> @@ -268,7 +268,7 @@ static int bisect_write(const char *state, const char *rev,
>  	} else if (one_of(state, terms->term_good, "skip", NULL)) {
>  		strbuf_addf(&tag, "refs/bisect/%s-%s", state, rev);
>  	} else {
> -		res = error(_("Bad bisect_write argument: %s"), state);
> +		res = error(_("bad '%s' argument: '%s'"), "bisect_write", state);
>  		goto finish;
>  	}

I think these should all say "bad value provided for '%s' argument:
'%s'", or similar, or maybe the terse version is better. Just a
suggestion.

> diff --git a/builtin/config.c b/builtin/config.c
> index e7b88a9c08d..2ac36e4f641 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -106,7 +106,7 @@ static int option_parse_type(const struct option *opt, const char *arg,
>  		else if (!strcmp(arg, "color"))
>  			new_type = TYPE_COLOR;
>  		else
> -			die(_("unrecognized --type argument, %s"), arg);
> +			die(_("bad '%s' argument: '%s'"), "--type", arg);
>  	}

I thought some of these were introducing logic errors, because we were
conflating unrecognized arguments with bad values, but these all seem to
actually mean "bad value", not "unknown flag".

> diff --git a/grep.c b/grep.c
> index 82eb7da1022..6aabfc58bb3 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -43,7 +43,7 @@ static int parse_pattern_type_arg(const char *opt, const char *arg)
>  		return GREP_PATTERN_TYPE_FIXED;
>  	else if (!strcmp(arg, "perl"))
>  		return GREP_PATTERN_TYPE_PCRE;
> -	die("bad %s argument: %s", opt, arg);
> +	die("bad '%s' argument: '%s'", opt, arg);
>  }

This and many other changes that follow have nothing to do with i18n.

I think it's a worthwhile cleanup to mark some of these for _(), but
shouldn't that come first, or at least after?

      reply	other threads:[~2022-04-03 14:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-20 21:54 [PATCH 0/7] More i18n fixes Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 1/7] i18n: factorize generic failure messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 2/7] sequencer: factor GIT_AUTHOR_* from message strings Bagas Sanjaya via GitGitGadget
2022-03-21  5:22   ` Bagas Sanjaya
2022-03-20 21:54 ` [PATCH 3/7] i18n: factorize "bad argument" messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 4/7] i18n: factorize "Server does not support foo" messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 5/7] i18n: factorize "foo does not take arguments" messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 6/7] i18n: factorize read-cache error messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 7/7] i18n: factorize unrecognized options arguments messages Jean-Noël Avila via GitGitGadget
2022-03-21  6:48 ` [PATCH 0/7] More i18n fixes Johannes Sixt
2022-03-21 13:59   ` Ævar Arnfjörð Bjarmason
2022-03-21 19:03     ` Junio C Hamano
2022-03-21 20:13       ` Jean-Noël AVILA
2022-03-21 20:35     ` Jean-Noël AVILA
2022-04-02 16:10 ` [PATCH v2 0/6] " Jean-Noël Avila via GitGitGadget
2022-04-02 16:10   ` [PATCH v2 1/6] i18n: factorize generic failure messages Jean-Noël Avila via GitGitGadget
2022-04-03  5:56     ` Bagas Sanjaya
2022-04-03 14:34       ` Ævar Arnfjörð Bjarmason
2022-04-03 14:47     ` Ævar Arnfjörð Bjarmason
2022-04-02 16:10   ` [PATCH v2 2/6] sequencer: factor GIT_AUTHOR_* from message strings Bagas Sanjaya via GitGitGadget
2022-04-02 16:10   ` [PATCH v2 3/6] i18n: factorize server support messages in fetch-pack Jean-Noël Avila via GitGitGadget
2022-04-02 16:10   ` [PATCH v2 4/6] i18n: factorize "foo does not take arguments" messages Jean-Noël Avila via GitGitGadget
2022-04-03 14:39     ` Ævar Arnfjörð Bjarmason
2022-04-03 22:21       ` Junio C Hamano
2022-04-02 16:10   ` [PATCH v2 5/6] i18n: factorize read-cache error messages Jean-Noël Avila via GitGitGadget
2022-04-03 22:29     ` Junio C Hamano
2022-04-02 16:10   ` [PATCH v2 6/6] i18n: factorize "bad argument" messages Jean-Noël Avila via GitGitGadget
2022-04-03 14:41     ` Ævar Arnfjörð Bjarmason [this message]

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=220403.86o81ikywa.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=j6t@kdbg.org \
    --cc=jn.avila@free.fr \
    /path/to/YOUR_REPLY

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

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