git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t/lib-httpd: pass LANG to Apache

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 5, 2022, 19:50 UTC
Message-ID
<xmqqtu4inj6q.fsf@gitster.g>
In-Reply-To
<3b370f7b-df84-0629-d334-aa9dfbca1c05@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 10 quoted lines
> t5411 starts a web server with no explicit language setting, so it uses
> the system default.  Ten of its tests expect it to return error messages
> containing the prefix "fatal: ", emitted by die().  This prefix can be
> localized since a1fd2cf8cd (i18n: mark message helpers prefix for
> translation, 2022-06-21), however.  As a result these ten tests break
> for me on a system with LANG="de_DE.UTF-8" because the web server sends
> localized messages with "Schwerwiegend: " instead of "fatal: ".
>
> Fix these tests by passing LANG to the web server, which is set to "C"
> by t/test-lib.sh, to get untranslated messages on both sides.

It is a good thing to do, but we seem to be extra conservative and set both LC_ALL=C LANG=C (presumably by following the habit acquired back when locale support were being introduced to various systems with different degree, which way predates Git itself) and export them in the main part of the test framework.

Shouldn't we be doing the same here?
Show 19 quoted lines
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
>  t/lib-httpd/apache.conf | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
> index 497b9b9d92..1e2295a7cb 100644
> --- a/t/lib-httpd/apache.conf
> +++ b/t/lib-httpd/apache.conf
> @@ -80,6 +80,7 @@ PassEnv LSAN_OPTIONS
>  PassEnv GIT_TRACE
>  PassEnv GIT_CONFIG_NOSYSTEM
>  PassEnv GIT_TEST_SIDEBAND_ALL
> +PassEnv LANG
>
>  Alias /dumb/ www/
>  Alias /auth/dumb/ www/auth/dumb/
> --
> 2.37.3
Previous: René ScharfeNext: Jeff King
Message 2 of 5 in “t/lib-httpd: pass LANG to Apache”
  1. t/lib-httpd: pass LANG to ApacheRené Scharfe, Oct 4, 2022
  2. Junio C HamanoOct 5, 2022
  3. Jeff KingOct 5, 2022
  4. t/lib-httpd: pass LANG and LC_ALL to ApacheRené Scharfe, Oct 6, 2022
  5. Junio C HamanoOct 6, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.