Git development
 help / color / mirror / Atom feed
* [GSoC Patch 0/2] add unicode support to git repo structure
@ 2026-08-21 13:53 K Jayatheerth
  2026-08-21 13:53 ` [GSoC Patch 1/2] gettext: fall back to env-derived charset when unset K Jayatheerth
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: K Jayatheerth @ 2026-08-21 13:53 UTC (permalink / raw)
  To: git; +Cc: jltobler, lucasseikioshiro, K Jayatheerth

Currently, `git repo structure` always renders its table output using plain
ASCII characters (`|`, `-`, `*`), regardless of the user's locale. This
series introduces Unicode box-drawing characters (`│`, `├`, `─`, `┼`, `┤`)
and bullet points (`•`) when a UTF-8 locale is detected, providing a cleaner
and more visually distinct hierarchical output on modern terminals while
gracefully falling back to the existing ASCII formatting otherwise.

Summary of changes:

- Patch 1 (gettext: fall back to env-derived charset when unset):
  Fixes an issue where `is_utf8_locale()` would leave `charset` unset (NULL)
  when `git_setup_gettext()` returns early upon missing the locale directory
  (such as in uninstalled development builds). Because `is_encoding_utf8(NULL)`
  defaults to 1, `is_utf8_locale()` would mistakenly report a UTF-8 locale
  even under non-UTF-8 environments like `LC_ALL=C`. This patch enables the
  environment-derived fallback (`LC_ALL`, `LC_CTYPE`, `LANG`) whenever `charset`
  is unset, regardless of `NO_GETTEXT`.

- Patch 2 (repo: add Unicode support for `repo structure` output):
  Updates `builtin/repo.c` (`stats_table_setup_structure()` and
  `stats_table_print_structure()`) to query `is_utf8_locale()` and emit
  Unicode box-drawing borders and bullets when running under a UTF-8 locale,
  falling back to ASCII when not in UTF-8. In `t/t1901-repo-structure.sh`,
  tests follow the established `t/lib-git-svn.sh` convention for discovering
  `GIT_TEST_UTF8_LOCALE` to define a `UTF8_LOCALE` test prerequisite, existing
  tests are pinned to `LC_ALL=C` to reliably test the ASCII fallback path,
  and new tests are added to verify the UTF-8 output rendering (including
  when running with a missing locale directory).

K Jayatheerth (2):
  gettext: fall back to env-derived charset when unset
  repo: add Unicode support for `repo structure` output

 builtin/repo.c            | 110 ++++++++++++++++-------------
 gettext.c                 |  32 +++++----
 t/t1901-repo-structure.sh | 141 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 221 insertions(+), 62 deletions(-)

-- 
2.55.GIT

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-21 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 13:53 [GSoC Patch 0/2] add unicode support to git repo structure K Jayatheerth
2026-08-21 13:53 ` [GSoC Patch 1/2] gettext: fall back to env-derived charset when unset K Jayatheerth
2026-08-21 13:53 ` [GSoC Patch 2/2] repo: add Unicode support for `repo structure` output K Jayatheerth
2026-08-21 16:59 ` [GSoC Patch 0/2] add unicode support to git repo structure Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox