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

[PATCH] remote.c: specify correct plural form in "commit diverge" message

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
May 3, 2016, 00:12 UTC
Message-ID
<1462234350-30902-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<2A734D896A45164C887E476E942BF4F9B5F721@CINMBCNA09.e2k.ad.ge.com>

We need to count both "ours" and "theirs" commits when selecting plural form for this message. Note that even though in this block, both ours and theirs must be positive (i.e. can't be in singular form), we still keep Q_(singular, plural) because languages other than English may have more than one plural form.

Reported-by: Alfonsogonzalez, Ernesto (GE Digital) <ernesto.alfonsogonzalez@ge.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 remote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/remote.c b/remote.c
index 28fd676..212426e 100644
--- a/remote.c
+++ b/remote.c
@@ -2108,7 +2108,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
 			   "Your branch and '%s' have diverged,\n"
 			       "and have %d and %d different commits each, "
 			       "respectively.\n",
-			   theirs),
+			   ours + theirs),
 			base, ours, theirs);
 		if (advice_status_hints)
 			strbuf_addf(sb,
-- 
2.8.0.rc0.210.gd302cd2
Previous: Alfonsogonzalez, Ernesto (GE Digital)Next: Stefan Beller
Message 2 of 8 in “bug: incorrect plurality of "commit" in git status”
  1. Alfonsogonzalez, Ernesto (GE Digital)May 2, 2016
  2. remote.c: specify correct plural form in "commit diverge" messageNguyễn Thái Ngọc Duy, May 3, 2016
  3. Stefan BellerMay 3, 2016
  4. Duy NguyenMay 3, 2016
  5. Jeff KingMay 3, 2016
  6. Duy NguyenMay 3, 2016
  7. Jeff KingMay 3, 2016
  8. Duy NguyenMay 3, 2016

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.