{"thread":{"id":"66589","subject":"[GSoC PATCH] fsck: use Q_() for the verbose connectivity message","startedAt":"2026-10-19T15:37:25Z","lastAt":"2026-10-19T22:11:23Z","messageCount":2,"participants":["Aniket Gupta","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"555429","messageId":"20261019153725.333-1-aniketgupta3001@gmail.com","threadId":"66589","inReplyTo":null,"subject":"[GSoC PATCH] fsck: use Q_() for the verbose connectivity message","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-10-19T15:37:25Z","receivedAt":"2026-10-19T15:37:25Z","isPatch":true,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"The verbose \"Checking connectivity\" message has the word \"objects\"\nhardcoded as a plural inside a plain _(), so translators can't give the\nright form for the number. Use Q_() like the other count messages so\ngettext can pick it. English output stays the same.\n\nSigned-off-by: Aniket Gupta <aniketgupta3001@gmail.com>\n---\nThe number printed here comes from the hash table size in\nget_max_object_index() and not a real object count, so it never\nsays 1. Left that alone, can look at it separately if people think\nit's worth it.\n\n builtin/fsck.c | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex 9af4cc085..fedf8f853 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -379,7 +379,10 @@ static void check_connectivity(struct repository *repo)\n \t/* Look up all the requirements, warn about missing objects.. */\n \tmax = get_max_object_index(repo);\n \tif (verbose)\n-\t\tfprintf_ln(stderr, _(\"Checking connectivity (%d objects)\"), max);\n+\t\tfprintf_ln(stderr, Q_(\"Checking connectivity (%d object)\",\n+\t\t\t\t      \"Checking connectivity (%d objects)\",\n+\t\t\t\t      max),\n+\t\t\t   max);\n \n \tfor (i = 0; i < max; i++) {\n \t\tstruct object *obj = get_indexed_object(repo, i);\n-- \n2.56.0.186.gc51408889.dirty\n\n\n"},{"id":"555477","messageId":"xmqqld7t1gtw.fsf@gitster.g","threadId":"66589","inReplyTo":"20261019153725.333-1-aniketgupta3001@gmail.com","subject":"Re: [GSoC PATCH] fsck: use Q_() for the verbose connectivity message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-19T22:11:23Z","receivedAt":"2026-10-19T22:11:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Aniket Gupta <aniketgupta3001@gmail.com> writes:\n\n> The verbose \"Checking connectivity\" message has the word \"objects\"\n> hardcoded as a plural inside a plain _(), so translators can't give the\n> right form for the number. Use Q_() like the other count messages so\n> gettext can pick it. English output stays the same.\n>\n> Signed-off-by: Aniket Gupta <aniketgupta3001@gmail.com>\n> ---\n> The number printed here comes from the hash table size in\n> get_max_object_index() and not a real object count, so it never\n> says 1. Left that alone, can look at it separately if people think\n> it's worth it.\n\nThe size of the hashtable we use ought to be comfortably larger than\nthe actual number of objects we are looking at for the hashtable to\nperform well, so the number we are showing indeed is not the actual\nnumber of objects.  Nevertheless, using Q_() is the right thing to\ndo here, especially to support languages with more complex plural\nforms.\n\nWe _could_ add a NEEDSWORK comment near there to say that future\ndevelopers may want to think about the number being inaccurate and\ndo something about it (or not), but I think your decision not to\naddress the inaccuracies in this patch even though you noticed it is\nthe right one.\n\nWill queue.  Thanks.\n\n>  builtin/fsck.c | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/builtin/fsck.c b/builtin/fsck.c\n> index 9af4cc085..fedf8f853 100644\n> --- a/builtin/fsck.c\n> +++ b/builtin/fsck.c\n> @@ -379,7 +379,10 @@ static void check_connectivity(struct repository *repo)\n>  \t/* Look up all the requirements, warn about missing objects.. */\n>  \tmax = get_max_object_index(repo);\n>  \tif (verbose)\n> -\t\tfprintf_ln(stderr, _(\"Checking connectivity (%d objects)\"), max);\n> +\t\tfprintf_ln(stderr, Q_(\"Checking connectivity (%d object)\",\n> +\t\t\t\t      \"Checking connectivity (%d objects)\",\n> +\t\t\t\t      max),\n> +\t\t\t   max);\n>  \n>  \tfor (i = 0; i < max; i++) {\n>  \t\tstruct object *obj = get_indexed_object(repo, i);\n\n"}]}