git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Andrew Klotz via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Andrew Klotz <agc.klotz@gmail.com>
Subject: Re: [PATCH 0/2] config: improve error message for boolean config
Date: Fri, 18 Sep 2020 10:22:32 -0700	[thread overview]
Message-ID: <xmqqmu1nm23r.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <pull.841.git.git.1600395427.gitgitgadget@gmail.com> (Andrew Klotz via GitGitGadget's message of "Fri, 18 Sep 2020 02:17:05 +0000")

"Andrew Klotz via GitGitGadget" <gitgitgadget@gmail.com> writes:

> Currently invalid boolean config values return messages about 'bad numeric',
> which I found misleading when the error was due to a boolean string value.
> This change makes the error message reflect the boolean value.
>
> The current approach relies on GIT_TEST_GETTEXT_POISON being a boolean
> value, moving its special case out fromdie_bad_number() and into 
> git_config_bool_or_int().

The approach does not make anything worse than what we currently
have, which is good.

I am undecided if we want to apply 2/2, or if we want to apply 1/2
alone without 2/2.  If we applied 2/2, those who are reading the
code in a year who forgot about this review thread would have to
wonder if all values assigned to the variable bad_numeric are
enclosed in _() and go up to find all assignments.

Omitting 2/2 would keep _() around the message string fed to die(),
so it may be easier to immediately see that the call to die is not
missing basic i18n, but there is a risk to forget marking with N_().

If we were to use 2/2 in addition to 1/2, then squashing them into
one commit will make the result easier to follow, because we no
longer need an untranslated string in bad_numeric after 1/2 is
applied.  We are losing "the reason why we use N_() is..." comment
in 1/2 anyway so doing what 2/2 does in the same commit would be
more sensible than splitting these into two patches.

I dunno.

Thanks.


  parent reply	other threads:[~2020-09-18 17:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18  2:17 [PATCH 0/2] config: improve error message for boolean config Andrew Klotz via GitGitGadget
2020-09-18  2:17 ` [PATCH 1/2] " Andrew Klotz via GitGitGadget
2020-09-18 18:10   ` Jeff King
2020-09-18 18:30   ` Phillip Wood
2020-09-18 19:14     ` Junio C Hamano
2020-09-18  2:17 ` [PATCH 2/2] formatting for error messages Andrew Klotz via GitGitGadget
2020-09-18 17:22 ` Junio C Hamano [this message]
2021-02-09  1:25 ` [PATCH v2] config: improve error message for boolean config Andrew Klotz via GitGitGadget
2021-02-09 16:51   ` Jeff King
2021-02-09 21:02     ` Junio C Hamano
2021-02-11 20:30   ` [PATCH v3] " Andrew Klotz via GitGitGadget
2021-02-12 10:38     ` Jeff King
2021-02-12 19:52       ` Junio C Hamano

Reply instructions:

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

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

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqmu1nm23r.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=agc.klotz@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).