Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Aniket Gupta <aniketgupta3001@gmail.com>
Cc: git@vger.kernel.org,  Patrick Steinhardt <ps@pks.im>
Subject: Re: [GSoC PATCH] fsck: use Q_() for the verbose connectivity message
Date: Mon, 19 Oct 2026 15:11:23 -0700	[thread overview]
Message-ID: <xmqqld7t1gtw.fsf@gitster.g> (raw)
In-Reply-To: <20261019153725.333-1-aniketgupta3001@gmail.com> (Aniket Gupta's message of "Mon, 19 Oct 2026 15:37:25 +0000")

Aniket Gupta <aniketgupta3001@gmail.com> writes:

> The verbose "Checking connectivity" message has the word "objects"
> hardcoded as a plural inside a plain _(), so translators can't give the
> right form for the number. Use Q_() like the other count messages so
> gettext can pick it. English output stays the same.
>
> Signed-off-by: Aniket Gupta <aniketgupta3001@gmail.com>
> ---
> The number printed here comes from the hash table size in
> get_max_object_index() and not a real object count, so it never
> says 1. Left that alone, can look at it separately if people think
> it's worth it.

The size of the hashtable we use ought to be comfortably larger than
the actual number of objects we are looking at for the hashtable to
perform well, so the number we are showing indeed is not the actual
number of objects.  Nevertheless, using Q_() is the right thing to
do here, especially to support languages with more complex plural
forms.

We _could_ add a NEEDSWORK comment near there to say that future
developers may want to think about the number being inaccurate and
do something about it (or not), but I think your decision not to
address the inaccuracies in this patch even though you noticed it is
the right one.

Will queue.  Thanks.

>  builtin/fsck.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/fsck.c b/builtin/fsck.c
> index 9af4cc085..fedf8f853 100644
> --- a/builtin/fsck.c
> +++ b/builtin/fsck.c
> @@ -379,7 +379,10 @@ static void check_connectivity(struct repository *repo)
>  	/* Look up all the requirements, warn about missing objects.. */
>  	max = get_max_object_index(repo);
>  	if (verbose)
> -		fprintf_ln(stderr, _("Checking connectivity (%d objects)"), max);
> +		fprintf_ln(stderr, Q_("Checking connectivity (%d object)",
> +				      "Checking connectivity (%d objects)",
> +				      max),
> +			   max);
>  
>  	for (i = 0; i < max; i++) {
>  		struct object *obj = get_indexed_object(repo, i);

      reply	other threads:[~2026-10-19 22:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 15:37 [GSoC PATCH] fsck: use Q_() for the verbose connectivity message Aniket Gupta
2026-10-19 22:11 ` Junio C Hamano [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=xmqqld7t1gtw.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=aniketgupta3001@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    /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