From: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
To: git@vger.kernel.org
Cc: jltobler@gmail.com, lucasseikioshiro@gmail.com,
K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Subject: [GSoC Patch 0/2] add unicode support to git repo structure
Date: Fri, 21 Aug 2026 19:23:43 +0530 [thread overview]
Message-ID: <20260821135410.429698-1-jayatheerthkulkarni2005@gmail.com> (raw)
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
next reply other threads:[~2026-08-21 13:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 13:53 K Jayatheerth [this message]
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
2026-08-23 13:19 ` Oswald Buddenhagen
2026-08-23 15:01 ` Junio C Hamano
2026-08-23 17:06 ` Tuomas Ahola
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=20260821135410.429698-1-jayatheerthkulkarni2005@gmail.com \
--to=jayatheerthkulkarni2005@gmail.com \
--cc=git@vger.kernel.org \
--cc=jltobler@gmail.com \
--cc=lucasseikioshiro@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.