{"thread":{"id":"64817","subject":"[PATCH] help: report on whether or not gettext is enabled","startedAt":"2026-01-16T02:29:55Z","lastAt":"2026-01-20T05:47:44Z","messageCount":7,"participants":["Jiang Xin","Junio C Hamano","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"534009","messageId":"f3500e698fd40297d2e2634785529b76d49ca470.1768530514.git.zhiyou.jx@alibaba-inc.com","threadId":"64817","inReplyTo":null,"subject":"[PATCH] help: report on whether or not gettext is enabled","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2026-01-16T02:29:40Z","receivedAt":"2026-01-16T02:29:55Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nWhen users report that Git has no localized output, we need to check not\nonly their locale settings, but also whether Git was built with GETTEXT\nsupport in the first place.\n\nExpose this information via the existing build info output by adding a\n\"gettext: enabled|disabled\" line to `git version --build-options` (and\ntherefore also to `git bugreport`). The status is derived from whether\n`NO_GETTEXT` is defined at build time.\n\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n help.c | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/help.c b/help.c\nindex 20e114432d..96d70d8e6c 100644\n--- a/help.c\n+++ b/help.c\n@@ -799,6 +799,11 @@ void get_version_info(struct strbuf *buf, int show_build_options)\n \n \t\tif (fsmonitor_ipc__is_supported())\n \t\t\tstrbuf_addstr(buf, \"feature: fsmonitor--daemon\\n\");\n+#if defined NO_GETTEXT\n+\t\tstrbuf_addstr(buf, \"gettext: disabled\\n\");\n+#else\n+\t\tstrbuf_addstr(buf, \"gettext: enabled\\n\");\n+#endif\n #if defined LIBCURL_VERSION\n \t\tstrbuf_addf(buf, \"libcurl: %s\\n\", LIBCURL_VERSION);\n #endif\n-- \n2.52.0.435.g8745eae506\n\n"},{"id":"534049","messageId":"xmqqo6mta7bg.fsf@gitster.g","threadId":"64817","inReplyTo":"f3500e698fd40297d2e2634785529b76d49ca470.1768530514.git.zhiyou.jx@alibaba-inc.com","subject":"Re: [PATCH] help: report on whether or not gettext is enabled","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-01-16T15:46:59Z","receivedAt":"2026-01-16T15:47:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> When users report that Git has no localized output, we need to check not\n> only their locale settings, but also whether Git was built with GETTEXT\n> support in the first place.\n>\n> Expose this information via the existing build info output by adding a\n> \"gettext: enabled|disabled\" line to `git version --build-options` (and\n> therefore also to `git bugreport`). The status is derived from whether\n> `NO_GETTEXT` is defined at build time.\n>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  help.c | 5 +++++\n>  1 file changed, 5 insertions(+)\n>\n> diff --git a/help.c b/help.c\n> index 20e114432d..96d70d8e6c 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -799,6 +799,11 @@ void get_version_info(struct strbuf *buf, int show_build_options)\n>  \n>  \t\tif (fsmonitor_ipc__is_supported())\n>  \t\t\tstrbuf_addstr(buf, \"feature: fsmonitor--daemon\\n\");\n> +#if defined NO_GETTEXT\n> +\t\tstrbuf_addstr(buf, \"gettext: disabled\\n\");\n> +#else\n> +\t\tstrbuf_addstr(buf, \"gettext: enabled\\n\");\n> +#endif\n\nPresumably, we do not care too much about the version of this thing\nunlike ...\n\n>  #if defined LIBCURL_VERSION\n>  \t\tstrbuf_addf(buf, \"libcurl: %s\\n\", LIBCURL_VERSION);\n>  #endif\n\n... we do for the curl library, so only reporting \"enabled\" does\nfeel perfectly OK to me.\n\nI would prefer not to see the \"disabled\" entry myself, by the way.\nCombined with the vintage of Git binary that had these help text,\nthe fact that an \"enabled\" line is missing is enough clue to\ndiagnose.  I know you mimicked the Rust entry before this point\n(just above the precontext of the hunk), but I think we should fix\nit to drop the \"disabled\" entry from there.\n\nCc'ed the author of cb2badb4 (help: report on whether or not Rust is\nenabled, 2025-10-02).\n\n"},{"id":"534112","messageId":"251e1b533ca2e38a9bedae44360ce636cdea4bc3.1768657640.git.zhiyou.jx@alibaba-inc.com","threadId":"64817","inReplyTo":"xmqqo6mta7bg.fsf@gitster.g","subject":"[PATCH v2] help: report on whether or not gettext is enabled","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2026-01-17T13:59:38Z","receivedAt":"2026-01-17T13:59:47Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nWhen users report that Git has no localized output, we need to check not\nonly their locale settings, but also whether Git was built with GETTEXT\nsupport in the first place.\n\nExpose this information via the existing build info output by adding a\n\"gettext: enabled\" line to `git version --build-options` (and therefore\nalso to `git bugreport`) when `NO_GETTEXT` is not defined at build time.\n\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n help.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/help.c b/help.c\nindex 20e114432d..3c36d9c218 100644\n--- a/help.c\n+++ b/help.c\n@@ -799,6 +799,9 @@ void get_version_info(struct strbuf *buf, int show_build_options)\n \n \t\tif (fsmonitor_ipc__is_supported())\n \t\t\tstrbuf_addstr(buf, \"feature: fsmonitor--daemon\\n\");\n+#if !defined NO_GETTEXT\n+\t\tstrbuf_addstr(buf, \"gettext: enabled\\n\");\n+#endif\n #if defined LIBCURL_VERSION\n \t\tstrbuf_addf(buf, \"libcurl: %s\\n\", LIBCURL_VERSION);\n #endif\n-- \n2.52.0.435.g8745eae506\n\n"},{"id":"534172","messageId":"aW3XUxaomqGbtpEj@pks.im","threadId":"64817","inReplyTo":"xmqqo6mta7bg.fsf@gitster.g","subject":"Re: [PATCH] help: report on whether or not gettext is enabled","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-01-19T07:03:47Z","receivedAt":"2026-01-19T07:03:54Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Jan 16, 2026 at 07:46:59AM -0800, Junio C Hamano wrote:\n> > diff --git a/help.c b/help.c\n> > index 20e114432d..96d70d8e6c 100644\n> > --- a/help.c\n> > +++ b/help.c\n> > @@ -799,6 +799,11 @@ void get_version_info(struct strbuf *buf, int show_build_options)\n> >  \n> >  \t\tif (fsmonitor_ipc__is_supported())\n> >  \t\t\tstrbuf_addstr(buf, \"feature: fsmonitor--daemon\\n\");\n> > +#if defined NO_GETTEXT\n> > +\t\tstrbuf_addstr(buf, \"gettext: disabled\\n\");\n> > +#else\n> > +\t\tstrbuf_addstr(buf, \"gettext: enabled\\n\");\n> > +#endif\n> \n> Presumably, we do not care too much about the version of this thing\n> unlike ...\n> \n> >  #if defined LIBCURL_VERSION\n> >  \t\tstrbuf_addf(buf, \"libcurl: %s\\n\", LIBCURL_VERSION);\n> >  #endif\n> \n> ... we do for the curl library, so only reporting \"enabled\" does\n> feel perfectly OK to me.\n> \n> I would prefer not to see the \"disabled\" entry myself, by the way.\n> Combined with the vintage of Git binary that had these help text,\n> the fact that an \"enabled\" line is missing is enough clue to\n> diagnose.  I know you mimicked the Rust entry before this point\n> (just above the precontext of the hunk), but I think we should fix\n> it to drop the \"disabled\" entry from there.\n> \n> Cc'ed the author of cb2badb4 (help: report on whether or not Rust is\n> enabled, 2025-10-02).\n\nOne reason why I personally prefer to have enabled/disabled is that it\nallows you to discern the following two cases:\n\n  - You have a modern version of Git that doesn't have gettext.\n\n  - You have an old version of Git that doesn't know to print\n    information about whether or not gettext is enabled.\n\nIf we don't print the info at all when gettext is disabled then it's\nimpossible to tell these two cases apart. That argument in my mind also\nextends to libcurl, where it would be more helpful to print \"libcurl:\ndisabled\" if it's not used.\n\nI don't feel particularly strong about this though.\n\nPatrick\n"},{"id":"534178","messageId":"CANYiYbGn-ANF4jT2Lef+uL=sfcVWukBH7J71VaapGkaDaYHFZA@mail.gmail.com","threadId":"64817","inReplyTo":"aW3XUxaomqGbtpEj@pks.im","subject":"Re: [PATCH] help: report on whether or not gettext is enabled","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2026-01-19T10:17:45Z","receivedAt":"2026-01-19T10:17:57Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Mon, Jan 19, 2026 at 3:03 PM Patrick Steinhardt <ps@pks.im> wrote:\n> > ... we do for the curl library, so only reporting \"enabled\" does\n> > feel perfectly OK to me.\n> >\n> > I would prefer not to see the \"disabled\" entry myself, by the way.\n> > Combined with the vintage of Git binary that had these help text,\n> > the fact that an \"enabled\" line is missing is enough clue to\n> > diagnose.  I know you mimicked the Rust entry before this point\n> > (just above the precontext of the hunk), but I think we should fix\n> > it to drop the \"disabled\" entry from there.\n> >\n> > Cc'ed the author of cb2badb4 (help: report on whether or not Rust is\n> > enabled, 2025-10-02).\n>\n> One reason why I personally prefer to have enabled/disabled is that it\n> allows you to discern the following two cases:\n>\n>   - You have a modern version of Git that doesn't have gettext.\n>\n>   - You have an old version of Git that doesn't know to print\n>     information about whether or not gettext is enabled.\n>\n> If we don't print the info at all when gettext is disabled then it's\n> impossible to tell these two cases apart. That argument in my mind also\n\nBoth `git version --build-options` and `git bugreport` display the\nGit version number. This allows us to identify whether we're\nlooking at an old version that predates the gettext feature,\nor a modern version where we can expect gettext status to\nbe explicitly reported (even if disabled).\n\nIn reroll v2, I considered outputting GIT_LOCALE_PATH\ninstead of \"enabled\" for gettext, but that would have required\nrefactoring git_setup_gettext() in gettext.c. The benefit didn't\nseem worth the effort, so I dropped it.\n\n--\nJiang Xin\n"},{"id":"534198","messageId":"xmqqsec13zsd.fsf@gitster.g","threadId":"64817","inReplyTo":"aW3XUxaomqGbtpEj@pks.im","subject":"Re: [PATCH] help: report on whether or not gettext is enabled","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-01-20T00:15:14Z","receivedAt":"2026-01-20T00:15:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n>> Combined with the vintage of Git binary that had these help text,\n>> the fact that an \"enabled\" line is missing is enough clue to\n>> diagnose.\n>> ...\n>\n> One reason why I personally prefer to have enabled/disabled is that it\n> allows you to discern the following two cases:\n>\n>   - You have a modern version of Git that doesn't have gettext.\n>\n>   - You have an old version of Git that doesn't know to print\n>     information about whether or not gettext is enabled.\n\nWhen you see no \"gettext:\" line in the report, you can tell between\nthe above two cases by looking at what the first entry in the same\nreport \"git version --build-options\" produced, which is the Git\nversion, can't you?\n\n\n"},{"id":"534209","messageId":"aW8W-SzorzDC8-rg@pks.im","threadId":"64817","inReplyTo":"xmqqsec13zsd.fsf@gitster.g","subject":"Re: [PATCH] help: report on whether or not gettext is enabled","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-01-20T05:47:37Z","receivedAt":"2026-01-20T05:47:44Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Jan 19, 2026 at 04:15:14PM -0800, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> >> Combined with the vintage of Git binary that had these help text,\n> >> the fact that an \"enabled\" line is missing is enough clue to\n> >> diagnose.\n> >> ...\n> >\n> > One reason why I personally prefer to have enabled/disabled is that it\n> > allows you to discern the following two cases:\n> >\n> >   - You have a modern version of Git that doesn't have gettext.\n> >\n> >   - You have an old version of Git that doesn't know to print\n> >     information about whether or not gettext is enabled.\n> \n> When you see no \"gettext:\" line in the report, you can tell between\n> the above two cases by looking at what the first entry in the same\n> report \"git version --build-options\" produced, which is the Git\n> version, can't you?\n\nFair, that's possible. It still feels roundabout though as now the user\nalso needs to know when this feature was implemented. That's why I lean\ntowards just adding the info in both enabled and disabled cases: it\ngives you the information unconditionally. We don't really lose anything\non our side, and the end user has an easier job to figure out whether\nthe feature is enabled or not.\n\nBut as I said, I don't feel strongly enough about this to request any\nchanges.\n\nThanks!\n\nPatrick\n"}]}