From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>,
Jiang Xin <zhiyou.jx@alibaba-inc.com>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] t/lib-httpd: pass LANG to Apache
Date: Wed, 05 Oct 2022 12:50:53 -0700 [thread overview]
Message-ID: <xmqqtu4inj6q.fsf@gitster.g> (raw)
In-Reply-To: <3b370f7b-df84-0629-d334-aa9dfbca1c05@web.de> ("René Scharfe"'s message of "Tue, 4 Oct 2022 19:42:39 +0200")
René Scharfe <l.s.r@web.de> writes:
> 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?
> 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
next prev parent reply other threads:[~2022-10-05 19:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 17:42 [PATCH] t/lib-httpd: pass LANG to Apache René Scharfe
2022-10-05 19:50 ` Junio C Hamano [this message]
2022-10-05 21:20 ` Jeff King
2022-10-06 15:33 ` [PATCH v2] t/lib-httpd: pass LANG and LC_ALL " René Scharfe
2022-10-06 16:20 ` [PATCH] t/lib-httpd: pass LANG " Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqtu4inj6q.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
--cc=peff@peff.net \
--cc=zhiyou.jx@alibaba-inc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).