git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] remote: use plural-only message for diverged branch status

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 14, 2026, 16:52 UTC
Message-ID
<xmqqqzpmwdyi.fsf@gitster.g>
In-Reply-To
<pull.2239.git.git.1773479526823.gitgitgadget@gmail.com>
"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.
Show 33 quoted lines
> 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
Previous: Harald NordgrenNext: Junio C Hamano
Message 3 of 9 in “remote: use plural-only message for diverged branch status”
  1. remote: use plural-only message for diverged branch statusHarald Nordgren via GitGitGadget, Mar 14, 2026
  2. Harald NordgrenMar 14, 2026
  3. Junio C HamanoMar 14, 2026
  4. Junio C HamanoMar 14, 2026
  5. Phillip WoodMar 14, 2026
  6. Junio C HamanoMar 15, 2026
  7. Phillip WoodMar 16, 2026
  8. Junio C HamanoMar 16, 2026
  9. Kaartic SivaraamMar 25, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.