{"thread":{"id":"66523","subject":"[Microproject] describe: pluralize tag/commit count messages","startedAt":"2026-10-13T20:43:51Z","lastAt":"2026-11-07T04:56:03Z","messageCount":8,"participants":["Antoni Borowski","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"554914","messageId":"20261013204351.428800-1-antekborowski11@gmail.com","threadId":"66523","inReplyTo":null,"subject":"[Microproject] describe: pluralize tag/commit count messages","fromName":"Antoni Borowski","fromEmail":"antekborowski11@gmail.com","sentAt":"2026-10-13T20:43:51Z","receivedAt":"2026-10-13T20:43:51Z","isPatch":false,"sender":{"key":"antekborowski11@gmail.com","avatar":null},"body":"These two verbose messages hardcoded the English plural form\n(\"tags\"/\"commits\") inside _(), which is wrong both grammatically\n(e.g. \"found 1 tags\") and for i18n, since other languages have\ndifferent plural rules than English.\n\nSwitch both to Q_() so gettext picks the correct singular/plural\nform based on the count.\n\nSigned-off-by: Antoni Borowski <antekborowski11@gmail.com>\n---\n builtin/describe.c | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex c0abc931a5..9fbb982417 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -481,10 +481,12 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n \t\t\t\tlabel_width, _(prio_names[t->name->prio]),\n \t\t\t\tt->depth, t->name->path);\n \t\t}\n-\t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n+\t\tfprintf(stderr, Q_(\"traversed %lu commit\\n\",\n+\t\t\t\t   \"traversed %lu commits\\n\", seen_commits), seen_commits);\n \t\tif (gave_up_on) {\n \t\t\tfprintf(stderr,\n-\t\t\t\t_(\"found %i tags; gave up search at %s\\n\"),\n+\t\t\t\tQ_(\"found %i tag; gave up search at %s\\n\",\n+\t\t\t\t   \"found %i tags; gave up search at %s\\n\", max_candidates),\n \t\t\t\tmax_candidates,\n \t\t\t\toid_to_hex(&gave_up_on->object.oid));\n \t\t}\n-- \n2.56.0\n\n\n"},{"id":"554988","messageId":"20261014092923.GA1344504@coredump.intra.peff.net","threadId":"66523","inReplyTo":"20261013204351.428800-1-antekborowski11@gmail.com","subject":"Re: [Microproject] describe: pluralize tag/commit count messages","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-14T09:29:23Z","receivedAt":"2026-10-14T09:29:23Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 13, 2026 at 10:43:51PM +0200, Antoni Borowski wrote:\n\n> These two verbose messages hardcoded the English plural form\n> (\"tags\"/\"commits\") inside _(), which is wrong both grammatically\n> (e.g. \"found 1 tags\") and for i18n, since other languages have\n> different plural rules than English.\n> \n> Switch both to Q_() so gettext picks the correct singular/plural\n> form based on the count.\n\nOK. The patch looks obviously correct, though I do find it a little\nfunny that we bother to translate these debug messages in the first\nplace.\n\nI wonder if there is even really value in keeping \"--debug\" here at all.\nBut that is a somewhat bigger change.\n\nThe patch here seems OK to me in the meantime (and totally fine for a\nmicroproject).\n\n-Peff\n\n"},{"id":"555053","messageId":"xmqq4ieotc9x.fsf@gitster.g","threadId":"66523","inReplyTo":"20261014092923.GA1344504@coredump.intra.peff.net","subject":"Re: [Microproject] describe: pluralize tag/commit count messages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-14T17:36:26Z","receivedAt":"2026-10-14T17:36:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> OK. The patch looks obviously correct, though I do find it a little\n> funny that we bother to translate these debug messages in the first\n> place.\n>\n> I wonder if there is even really value in keeping \"--debug\" here at all.\n> But that is a somewhat bigger change.\n>\n> The patch here seems OK to me in the meantime (and totally fine for a\n> microproject).\n\nYeah, but a microproject that convincingly argues that output from\nthe \"--debug\" option should not even be translated and undoes _()\nwould make a much better case to see how a new person works well ;-).\n\n\n\n\n"},{"id":"555254","messageId":"20261016171835.90420-1-antekborowski11@gmail.com","threadId":"66523","inReplyTo":"xmqq4ieotc9x.fsf@gitster.g","subject":"[Microproject] describe: do not translate --debug output","fromName":"Antoni Borowski","fromEmail":"antekborowski11@gmail.com","sentAt":"2026-10-16T17:18:35Z","receivedAt":"2026-10-16T17:18:35Z","isPatch":false,"sender":{"key":"antekborowski11@gmail.com","avatar":null},"body":"The --debug flag is aimed at developers debugging describe's search\nstrategy, not at end users. Translating this output makes it harder\nto grep for known strings, compare logs across locales, or paste\noutput into upstream bug reports written in English — all things\ndevelopers routinely need to do.\n\ntransport-helper.c already follows this convention: its \"Debug: ...\"\nmessages are plain C strings with no gettext wrapper.\n\nDrop the _() and Q_() wrappers from describe_commit()'s debug-only\nfprintf() calls accordingly, and prefix them with \"Debug: \" to match\ntransport-helper.c's style.\n\nSigned-off-by: Antoni Borowski <antekborowski11@gmail.com>\n---\n builtin/describe.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex c0abc931a5..775f9f27f1 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -351,7 +351,7 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n \tif (!max_candidates)\n \t\tdie(_(\"no tag exactly matches '%s'\"), oid_to_hex(&cmit->object.oid));\n \tif (debug)\n-\t\tfprintf(stderr, _(\"No exact match on refs or tags, searching to describe\\n\"));\n+\t\tfprintf(stderr, \"Debug: No exact match on refs or tags, searching to describe\\n\");\n \n \tif (!have_util) {\n \t\tstruct hashmap_iter iter;\n@@ -419,7 +419,7 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n \t\t\t}\n \t\t\tif ((c->object.flags & best_within) == best_within) {\n \t\t\t\tif (debug)\n-\t\t\t\t\tfprintf(stderr, _(\"finished search at %s\\n\"),\n+\t\t\t\t\tfprintf(stderr, \"Debug: finished search at %s\\n\",\n \t\t\t\t\t\toid_to_hex(&c->object.oid));\n \t\t\t\tbreak;\n \t\t\t}\n@@ -477,14 +477,14 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n \t\t}\n \t\tfor (cur_match = 0; cur_match < match_cnt; cur_match++) {\n \t\t\tstruct possible_tag *t = &all_matches[cur_match];\n-\t\t\tfprintf(stderr, \" %-*s %8d %s\\n\",\n+\t\t\tfprintf(stderr, \"Debug:  %-*s %8d %s\\n\",\n \t\t\t\tlabel_width, _(prio_names[t->name->prio]),\n \t\t\t\tt->depth, t->name->path);\n \t\t}\n-\t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n+\t\tfprintf(stderr, \"Debug: traversed %lu commits\\n\", seen_commits);\n \t\tif (gave_up_on) {\n \t\t\tfprintf(stderr,\n-\t\t\t\t_(\"found %i tags; gave up search at %s\\n\"),\n+\t\t\t\t\"Debug: found %i tags; gave up search at %s\\n\",\n \t\t\t\tmax_candidates,\n \t\t\t\toid_to_hex(&gave_up_on->object.oid));\n \t\t}\n@@ -565,7 +565,7 @@ static void describe(const char *arg, int last_one)\n \tstruct strbuf sb = STRBUF_INIT;\n \n \tif (debug)\n-\t\tfprintf(stderr, _(\"describe %s\\n\"), arg);\n+\t\tfprintf(stderr, \"Debug: describe %s\\n\", arg);\n \n \tif (repo_get_oid(the_repository, arg, &oid))\n \t\tdie(_(\"Not a valid object name %s\"), arg);\n-- \n2.56.0\n\n\n"},{"id":"555261","messageId":"xmqqpkx9fq8o.fsf@gitster.g","threadId":"66523","inReplyTo":"20261016171835.90420-1-antekborowski11@gmail.com","subject":"Re: [Microproject] describe: do not translate --debug output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-16T18:35:19Z","receivedAt":"2026-10-16T18:35:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Antoni Borowski <antekborowski11@gmail.com> writes:\n\n> The --debug flag is aimed at developers debugging describe's search\n> strategy, not at end users. Translating this output makes it harder\n> to grep for known strings, compare logs across locales, or paste\n> output into upstream bug reports written in English — all things\n> developers routinely need to do.\n>\n> transport-helper.c already follows this convention: its \"Debug: ...\"\n> messages are plain C strings with no gettext wrapper.\n>\n> Drop the _() and Q_() wrappers from describe_commit()'s debug-only\n> fprintf() calls accordingly, and prefix them with \"Debug: \" to match\n> transport-helper.c's style.\n\nNicely described.  One nit in the proposed log message is that you\nare not removing any Q_() at all ;-).\n\n> Signed-off-by: Antoni Borowski <antekborowski11@gmail.com>\n> ---\n>  builtin/describe.c | 12 ++++++------\n>  1 file changed, 6 insertions(+), 6 deletions(-)\n\n\n\n> diff --git a/builtin/describe.c b/builtin/describe.c\n> index c0abc931a5..775f9f27f1 100644\n> --- a/builtin/describe.c\n> +++ b/builtin/describe.c\n> @@ -351,7 +351,7 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n>  \tif (!max_candidates)\n>  \t\tdie(_(\"no tag exactly matches '%s'\"), oid_to_hex(&cmit->object.oid));\n>  \tif (debug)\n> -\t\tfprintf(stderr, _(\"No exact match on refs or tags, searching to describe\\n\"));\n> +\t\tfprintf(stderr, \"Debug: No exact match on refs or tags, searching to describe\\n\");\n>  \n>  \tif (!have_util) {\n>  \t\tstruct hashmap_iter iter;\n> @@ -419,7 +419,7 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n>  \t\t\t}\n>  \t\t\tif ((c->object.flags & best_within) == best_within) {\n>  \t\t\t\tif (debug)\n> -\t\t\t\t\tfprintf(stderr, _(\"finished search at %s\\n\"),\n> +\t\t\t\t\tfprintf(stderr, \"Debug: finished search at %s\\n\",\n>  \t\t\t\t\t\toid_to_hex(&c->object.oid));\n>  \t\t\t\tbreak;\n>  \t\t\t}\n> @@ -477,14 +477,14 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n>  \t\t}\n>  \t\tfor (cur_match = 0; cur_match < match_cnt; cur_match++) {\n>  \t\t\tstruct possible_tag *t = &all_matches[cur_match];\n> -\t\t\tfprintf(stderr, \" %-*s %8d %s\\n\",\n> +\t\t\tfprintf(stderr, \"Debug:  %-*s %8d %s\\n\",\n>  \t\t\t\tlabel_width, _(prio_names[t->name->prio]),\n>  \t\t\t\tt->depth, t->name->path);\n>  \t\t}\n> -\t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n> +\t\tfprintf(stderr, \"Debug: traversed %lu commits\\n\", seen_commits);\n>  \t\tif (gave_up_on) {\n>  \t\t\tfprintf(stderr,\n> -\t\t\t\t_(\"found %i tags; gave up search at %s\\n\"),\n> +\t\t\t\t\"Debug: found %i tags; gave up search at %s\\n\",\n>  \t\t\t\tmax_candidates,\n>  \t\t\t\toid_to_hex(&gave_up_on->object.oid));\n>  \t\t}\n> @@ -565,7 +565,7 @@ static void describe(const char *arg, int last_one)\n>  \tstruct strbuf sb = STRBUF_INIT;\n>  \n>  \tif (debug)\n> -\t\tfprintf(stderr, _(\"describe %s\\n\"), arg);\n> +\t\tfprintf(stderr, \"Debug: describe %s\\n\", arg);\n>  \n>  \tif (repo_get_oid(the_repository, arg, &oid))\n>  \t\tdie(_(\"Not a valid object name %s\"), arg);\n\n"},{"id":"555266","messageId":"20261016185418.162998-1-antekborowski11@gmail.com","threadId":"66523","inReplyTo":"xmqqpkx9fq8o.fsf@gitster.g","subject":"[Microproject v2] describe: do not translate --debug output","fromName":"Antoni Borowski","fromEmail":"antekborowski11@gmail.com","sentAt":"2026-10-16T18:54:18Z","receivedAt":"2026-10-16T18:54:18Z","isPatch":false,"sender":{"key":"antekborowski11@gmail.com","avatar":null},"body":"The --debug flag is aimed at developers debugging describe's search\nstrategy, not at end users. Translating this output makes it harder\nto grep for known strings, compare logs across locales, or paste\noutput into upstream bug reports written in English — all things\ndevelopers routinely need to do.\n\ntransport-helper.c already follows this convention: its \"Debug: ...\"\nmessages are plain C strings with no gettext wrapper.\n\nDrop the _() wrapper from describe_commit()'s and describe()'s\ndebug-only fprintf() calls accordingly, and prefix them with\n\"Debug: \" to match transport-helper.c's style.\n\nSigned-off-by: Antoni Borowski <antekborowski11@gmail.com>\n---\n builtin/describe.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex c0abc931a5..775f9f27f1 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -351,7 +351,7 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n \tif (!max_candidates)\n \t\tdie(_(\"no tag exactly matches '%s'\"), oid_to_hex(&cmit->object.oid));\n \tif (debug)\n-\t\tfprintf(stderr, _(\"No exact match on refs or tags, searching to describe\\n\"));\n+\t\tfprintf(stderr, \"Debug: No exact match on refs or tags, searching to describe\\n\");\n \n \tif (!have_util) {\n \t\tstruct hashmap_iter iter;\n@@ -419,7 +419,7 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n \t\t\t}\n \t\t\tif ((c->object.flags & best_within) == best_within) {\n \t\t\t\tif (debug)\n-\t\t\t\t\tfprintf(stderr, _(\"finished search at %s\\n\"),\n+\t\t\t\t\tfprintf(stderr, \"Debug: finished search at %s\\n\",\n \t\t\t\t\t\toid_to_hex(&c->object.oid));\n \t\t\t\tbreak;\n \t\t\t}\n@@ -477,14 +477,14 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n \t\t}\n \t\tfor (cur_match = 0; cur_match < match_cnt; cur_match++) {\n \t\t\tstruct possible_tag *t = &all_matches[cur_match];\n-\t\t\tfprintf(stderr, \" %-*s %8d %s\\n\",\n+\t\t\tfprintf(stderr, \"Debug:  %-*s %8d %s\\n\",\n \t\t\t\tlabel_width, _(prio_names[t->name->prio]),\n \t\t\t\tt->depth, t->name->path);\n \t\t}\n-\t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n+\t\tfprintf(stderr, \"Debug: traversed %lu commits\\n\", seen_commits);\n \t\tif (gave_up_on) {\n \t\t\tfprintf(stderr,\n-\t\t\t\t_(\"found %i tags; gave up search at %s\\n\"),\n+\t\t\t\t\"Debug: found %i tags; gave up search at %s\\n\",\n \t\t\t\tmax_candidates,\n \t\t\t\toid_to_hex(&gave_up_on->object.oid));\n \t\t}\n@@ -565,7 +565,7 @@ static void describe(const char *arg, int last_one)\n \tstruct strbuf sb = STRBUF_INIT;\n \n \tif (debug)\n-\t\tfprintf(stderr, _(\"describe %s\\n\"), arg);\n+\t\tfprintf(stderr, \"Debug: describe %s\\n\", arg);\n \n \tif (repo_get_oid(the_repository, arg, &oid))\n \t\tdie(_(\"Not a valid object name %s\"), arg);\n-- \n2.56.0\n\n\n---\nv2: fixed commit message, no Q_() was actually touched\n\n"},{"id":"557754","messageId":"xmqq7bipbcqq.fsf@gitster.g","threadId":"66523","inReplyTo":"20261016185418.162998-1-antekborowski11@gmail.com","subject":"Re: [Microproject v2] describe: do not translate --debug output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-07T02:23:57Z","receivedAt":"2026-11-07T02:23:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Antoni Borowski <antekborowski11@gmail.com> writes:\n\n> The --debug flag is aimed at developers debugging describe's search\n> strategy, not at end users. Translating this output makes it harder\n> to grep for known strings, compare logs across locales, or paste\n> output into upstream bug reports written in English — all things\n> developers routinely need to do.\n>\n> transport-helper.c already follows this convention: its \"Debug: ...\"\n> messages are plain C strings with no gettext wrapper.\n>\n> Drop the _() wrapper from describe_commit()'s and describe()'s\n> debug-only fprintf() calls accordingly, and prefix them with\n> \"Debug: \" to match transport-helper.c's style.\n>\n> Signed-off-by: Antoni Borowski <antekborowski11@gmail.com>\n> ---\n>  builtin/describe.c | 12 ++++++------\n>  1 file changed, 6 insertions(+), 6 deletions(-)\n\nOK, looking good.\n\nLet's mark the topic as ready for 'next'.\n\n> -\t\tfprintf(stderr, _(\"No exact match on refs or tags, searching to describe\\n\"));\n> +\t\tfprintf(stderr, \"Debug: No exact match on refs or tags, searching to describe\\n\");\n\nShame we do not have debugf() macro ;-)\n\n\n"},{"id":"557766","messageId":"xmqqjymp9r4s.fsf@gitster.g","threadId":"66523","inReplyTo":"20261016185418.162998-1-antekborowski11@gmail.com","subject":"Re: [Microproject v2] describe: do not translate --debug output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-07T04:56:03Z","receivedAt":"2026-11-07T04:56:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Antoni Borowski <antekborowski11@gmail.com> writes:\n\n> @@ -477,14 +477,14 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)\n>  \t\t}\n>  \t\tfor (cur_match = 0; cur_match < match_cnt; cur_match++) {\n>  \t\t\tstruct possible_tag *t = &all_matches[cur_match];\n> -\t\t\tfprintf(stderr, \" %-*s %8d %s\\n\",\n> +\t\t\tfprintf(stderr, \"Debug:  %-*s %8d %s\\n\",\n>  \t\t\t\tlabel_width, _(prio_names[t->name->prio]),\n>  \t\t\t\tt->depth, t->name->path);\n>  \t\t}\n\nThis one has _(translation) still lurking here.  prio_names[] should\nnot be translated.\n\nprio_names[] is defined as file-scope static.\n\n    static const char *prio_names[] = {\n            N_(\"head\"), N_(\"lightweight\"), N_(\"annotated\"),\n    };\n\nIn describe_commit(), the length of _(prio_names[]) is measured only\nfor debugging purposes (which is outside the pre-context of the\nabove hunk), and they are shown with the fprintf() we see above.\n\nThe values in prio_names[] should lose N_() around them, and all _()\naround prio_names[] should bbe removed to make this conversion\ncomplete.  Perhaps prio_names[] should be moved to that if (debug)\nblock, which is the only user of that array.  It may even make sense\nto rename prio_names[] to make it clear that it is only used for\ndebugging output and nothing else.\n\nSo, earlier I said this looks ready for 'next', but no, it still\nneeds a bit more work.\n\n\n"}]}