From: Junio C Hamano <gitster@pobox.com>
To: "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH] remote: use plural-only message for diverged branch status
Date: Sat, 14 Mar 2026 09:52:37 -0700 [thread overview]
Message-ID: <xmqqqzpmwdyi.fsf@gitster.g> (raw)
In-Reply-To: <pull.2239.git.git.1773479526823.gitgitgadget@gmail.com> (Harald Nordgren via GitGitGadget's message of "Sat, 14 Mar 2026 09:12:06 +0000")
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> Drop Q_() singular form and use _() with the plural string only.
I know the commit title talks about plural-only, but please make
sure that the body of the log message carries all the necessary
information to justify the change standalone. "In the else clause,
both ours and theirs are positive integers so ours+theirs must be at
least 2, hence there is no need to prepare singular and plural
variants of the message", or something to that effect, perhaps.
The patch text and the reasoning behind it does sound familiar and I
vaguely recall discussing about it ;-)
Thanks.
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
> format_branch_comparison: diverged message has only plural case
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2239%2FHaraldNordgren%2Fformat_branch_comparison__plural-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2239/HaraldNordgren/format_branch_comparison__plural-v1
> Pull-Request: https://github.com/git/git/pull/2239
>
> remote.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/remote.c b/remote.c
> index 7ca2a6501b..12136dfa23 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -2307,13 +2307,8 @@ static void format_branch_comparison(struct strbuf *sb,
> _(" (use \"git pull\" to update your local branch)\n"));
> } else {
> strbuf_addf(sb,
> - Q_("Your branch and '%s' have diverged,\n"
> - "and have %d and %d different commit each, "
> - "respectively.\n",
> - "Your branch and '%s' have diverged,\n"
> - "and have %d and %d different commits each, "
> - "respectively.\n",
> - ours + theirs),
> + _("Your branch and '%s' have diverged,\n"
> + "and have %d and %d different commits each, respectively.\n"),
> branch_name, ours, theirs);
> if (use_divergence_advice && advice_enabled(ADVICE_STATUS_HINTS))
> strbuf_addstr(sb,
>
> base-commit: dc6ecd5354dca88d51b6d6562777fc8fc10d77e1
next prev parent reply other threads:[~2026-03-14 16:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 9:12 [PATCH] remote: use plural-only message for diverged branch status Harald Nordgren via GitGitGadget
2026-03-14 9:16 ` [PATCH] checkout: add --autostash option for branch switching Harald Nordgren
2026-03-14 16:52 ` Junio C Hamano [this message]
2026-03-14 18:38 ` [PATCH] remote: use plural-only message for diverged branch status Junio C Hamano
2026-03-14 20:08 ` Phillip Wood
2026-03-15 2:08 ` Junio C Hamano
2026-03-16 10:49 ` Phillip Wood
2026-03-16 17:06 ` Junio C Hamano
2026-03-25 4:29 ` Kaartic Sivaraam
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=xmqqqzpmwdyi.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=haraldnordgren@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