Thread (6 messages) 6 messages, 3 authors, 11d ago

[Microproject] describe: pluralize tag/commit count messages

flat view

From: Antoni Borowski <hidden>
Date: 2026-10-13 20:44:05
Subsystem: the rest · Maintainer: Linus Torvalds

These two verbose messages hardcoded the English plural form
("tags"/"commits") inside _(), which is wrong both grammatically
(e.g. "found 1 tags") and for i18n, since other languages have
different plural rules than English.

Switch both to Q_() so gettext picks the correct singular/plural
form based on the count.

Signed-off-by: Antoni Borowski <redacted>
---
 builtin/describe.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/builtin/describe.c b/builtin/describe.c
index c0abc931a5..9fbb982417 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -481,10 +481,12 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)
 				label_width, _(prio_names[t->name->prio]),
 				t->depth, t->name->path);
 		}
-		fprintf(stderr, _("traversed %lu commits\n"), seen_commits);
+		fprintf(stderr, Q_("traversed %lu commit\n",
+				   "traversed %lu commits\n", seen_commits), seen_commits);
 		if (gave_up_on) {
 			fprintf(stderr,
-				_("found %i tags; gave up search at %s\n"),
+				Q_("found %i tag; gave up search at %s\n",
+				   "found %i tags; gave up search at %s\n", max_candidates),
 				max_candidates,
 				oid_to_hex(&gave_up_on->object.oid));
 		}
-- 
2.56.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help