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
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Mar 14, 2026, 20:08 UTC
Message-ID
<ca6e021e-0301-496d-8bd1-b646487ccbf6@gmail.com>
In-Reply-To
<xmqqtsuiuugy.fsf@gitster.g>
On 14/03/2026 18:38, Junio C Hamano wrote:
Show 8 quoted lines
> 
>      remote: don't use Q_() when it is not needed
> 
>      In this code path, both ours and theirs are already known to be
>      positive integers, so ours + theirs will always be plural, never
>      using the first variant given to Q_().
> 
>      Just use _() with the plural string only.

There can be more than one form of the plural string though. The gettext manual has the following example of the Polish translation of "file" for different numbers of files [1]

	1 plik
	2,3,4 pliki
	5-21 plików
	22-24 pliki
	25-31 plików

ngettext() handles that correctly, translating a single string without an associated count will not.

Thanks
Phillip

[1] https://www.gnu.org/software/gettext/manual/gettext.html#Additional-functions-for-plural-forms

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 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.