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

Re: [PATCH v4] t: use user-specified utf-8 locale for testing svn

From
Jeff King <peff@peff.net>
Date
Jun 8, 2021, 06:38 UTC
Message-ID
<YL8Qe31z1Q5/DkmF@coredump.intra.peff.net>
In-Reply-To
<20210607010844.24587-1-congdanhqx@gmail.com>
On Mon, Jun 07, 2021 at 08:08:44AM +0700, Đoàn Trần Công Danh wrote:
Show 17 quoted lines
> In some test-cases, UTF-8 locale is required. To find such locale,
> we're using the first available UTF-8 locale that returned by
> "locale -a".
> 
> However, the locale(1) utility is unavailable on some systems,
> e.g. Linux with musl libc.
> 
> However, without "locale -a", we can't guess provided UTF-8 locale.
> 
> Add a Makefile knob GIT_TEST_UTF8_LOCALE and activate it for
> linux-musl in our CI system.
> 
> Rename t/lib-git-svn.sh:prepare_a_utf8_locale to prepare_utf8_locale,
> since we no longer prepare the variable named "a_utf8_locale",
> but set up a fallback value for GIT_TEST_UTF8_LOCALE instead.
> The fallback will be LC_ALL, LANG environment variable,
> or the first UTF-8 locale from output of "locale -a", in that order.

This patch looks good to me. I have one tiny nit below, but I'm OK if it's left as-is:

> +prepare_utf8_locale () {
> +	if test -n "$GIT_TEST_UTF8_LOCALE"
> +	then
> +		: test_set_prereq UTF8

This ":" is really just a comment, but since it contains code we would like to run (but which actually gets run later), it confused me. Something like:

  : already set by the caller, nothing to do
would have made it easier to understand.
And then the rest of the function is pretty self-explanatory.
-Peff
Previous: Đoàn Trần Công DanhNext: Đoàn Trần Công Danh
Message 17 of 19 in “t: use user-specific utf-8 locale for testing”
  1. t: use user-specific utf-8 locale for testingĐoàn Trần Công Danh, Jun 2, 2021
  2. Taylor BlauJun 2, 2021
  3. Ævar Arnfjörð BjarmasonJun 8, 2021
  4. Jeff KingJun 3, 2021
  5. Bagas SanjayaJun 4, 2021
  6. Đoàn Trần Công DanhJun 4, 2021
  7. t: use user-specific utf-8 locale for testingĐoàn Trần Công Danh, Jun 6, 2021
  8. Torsten BögershausenJun 6, 2021
  9. Junio C HamanoJun 7, 2021
  10. t: use pre-defined utf-8 locale for testing svnĐoàn Trần Công Danh, Jun 7, 2021
  11. Junio C HamanoJun 7, 2021
  12. Torsten BögershausenJun 7, 2021
  13. Đoàn Trần Công DanhJun 7, 2021
  14. Jeff KingJun 8, 2021
  15. Đoàn Trần Công DanhJun 8, 2021
  16. t: use user-specified utf-8 locale for testing svnĐoàn Trần Công Danh, Jun 7, 2021
  17. Jeff KingJun 8, 2021
  18. t: use user-specified utf-8 locale for testing svnĐoàn Trần Công Danh, Jun 8, 2021
  19. Jeff KingJun 8, 2021

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.