From: Junio C Hamano <gitster@pobox.com>
To: Tanga Joris <tangajoris@gmail.com>
Cc: git@vger.kernel.org, christian.couder@gmail.com,
siddharthasthana31@gmail.com
Subject: Re: [Outreachy PATCH] checkout: use Q_() for the "... and %d more" message
Date: Wed, 21 Oct 2026 11:04:26 -0700 [thread overview]
Message-ID: <xmqqv76vnd5h.fsf@gitster.g> (raw)
In-Reply-To: <20261021022156.119947-1-tangajoris@gmail.com> (Tanga Joris's message of "Wed, 21 Oct 2026 05:21:56 +0300")
Tanga Joris <tangajoris@gmail.com> writes:
> When leaving orphaned commits behind, "git checkout" ends the list
> with " ... and %d more." using a plain _(), so translators are unable
> to give the correct plural form of the count. Use Q_() so gettext can
> pick it. English string output stays the same.
Is the last sentence worth saying? I am having a hard time
imagining who it helps.
Translators of a language that phrases "2 more" and "3 more" the
same way now have to translate this placeholder twice. At that
cost, however, we help translators of languages that need to phrase
"2 more", "3 more", and "5 more" differently.
That is something we may want to say instead.
> Signed-off-by: Tanga Joris <tangajoris@gmail.com>
> ---
> The count here is always 2 or more, because when only one commit is
> left over, the suggest_reattach() function lists it instead of printing
> this message. I still used Q_() because some languages, like Polish,
> use different words for 2-4 and for 5 or more.
>
> builtin/checkout.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 2d575a4f57..49239f029f 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -1085,7 +1085,9 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
> if (more == 1)
> describe_one_orphan(&sb, last);
> else
> - strbuf_addf(&sb, _(" ... and %d more.\n"), more);
> + strbuf_addf(&sb, Q_(" ... and %d more.\n",
> + " ... and %d more.\n",
> + more), more);
> }
>
> fprintf(stderr,
next prev parent reply other threads:[~2026-10-21 18:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 2:21 [Outreachy PATCH] checkout: use Q_() for the "... and %d more" message Tanga Joris
2026-10-21 18:04 ` Junio C Hamano [this message]
2026-10-21 21:04 ` Tanga Joris
2026-10-22 0:48 ` [Outreachy PATCH v2] checkout: use Q_() for messages with counts Tanga Joris
2026-10-23 17:55 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqv76vnd5h.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=siddharthasthana31@gmail.com \
--cc=tangajoris@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox