Thread (4 messages) 4 messages, 3 authors, 2026-01-19

Re: [PATCH] help: report on whether or not gettext is enabled

From: Patrick Steinhardt <hidden>
Date: 2026-01-19 07:03:54

Possibly related (same subject, not in this thread)

On Fri, Jan 16, 2026 at 07:46:59AM -0800, Junio C Hamano wrote:
quoted
diff --git a/help.c b/help.c
index 20e114432d..96d70d8e6c 100644
--- a/help.c
+++ b/help.c
@@ -799,6 +799,11 @@ void get_version_info(struct strbuf *buf, int show_build_options)
 
 		if (fsmonitor_ipc__is_supported())
 			strbuf_addstr(buf, "feature: fsmonitor--daemon\n");
+#if defined NO_GETTEXT
+		strbuf_addstr(buf, "gettext: disabled\n");
+#else
+		strbuf_addstr(buf, "gettext: enabled\n");
+#endif
Presumably, we do not care too much about the version of this thing
unlike ...
quoted
 #if defined LIBCURL_VERSION
 		strbuf_addf(buf, "libcurl: %s\n", LIBCURL_VERSION);
 #endif
... we do for the curl library, so only reporting "enabled" does
feel perfectly OK to me.

I would prefer not to see the "disabled" entry myself, by the way.
Combined with the vintage of Git binary that had these help text,
the fact that an "enabled" line is missing is enough clue to
diagnose.  I know you mimicked the Rust entry before this point
(just above the precontext of the hunk), but I think we should fix
it to drop the "disabled" entry from there.

Cc'ed the author of cb2badb4 (help: report on whether or not Rust is
enabled, 2025-10-02).
One reason why I personally prefer to have enabled/disabled is that it
allows you to discern the following two cases:

  - You have a modern version of Git that doesn't have gettext.

  - You have an old version of Git that doesn't know to print
    information about whether or not gettext is enabled.

If we don't print the info at all when gettext is disabled then it's
impossible to tell these two cases apart. That argument in my mind also
extends to libcurl, where it would be more helpful to print "libcurl:
disabled" if it's not used.

I don't feel particularly strong about this though.

Patrick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help