Re: [RFC] Support UTF-8 characters in Git alias names
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 9, 2026, 23:14 UTC
- Message-ID
- <xmqqecmt33xk.fsf@gitster.g>
- In-Reply-To
- <aYpiSHSxYS2fUUS1@fruit.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 14 quoted lines
> On 2026-02-09 at 14:55:51, Junio C Hamano wrote: >> "brian m. carlson" <sandals@crustytoothpaste.net> writes: >> >> > I don't think we have any Unicode normalization code at all in Git, >> > though, so if you want a quality implementation, that may be a thing we >> > need. >> >> Isn't NKC/NKD a macOS-only issue in practice? Anything on the >> command line "git" potty and "git-blah" built-in commands receive >> goes through precompose_argv_prefix() to be normalized on that >> platform. > > Normalization is not a macOS-only issue. Many accented characters can > be written in multiple ways,...
Yup, but that wasn't what I brought up macOS for. No sane person would write the same string in multiple ways on purpose and everybody would want to stick to one, so that byte-for-byte comparison can decide paths they created in the filesystem can be matched with a list of paths they added in .gitignore, for example. And for that everybody uses normalization form C, no?
But the macOS makes it harder to stick to a single way when it involves filesystem entities; the pathname you gave to a new file with your creat/open(2) may be normalized in macOS specific way when it comes back from readdir(2). Ahd for that glitch, we massage the strings we got from the command line and readdir(), which are in the normalization form D, into normalization form C.
I think the suggestion here is to assume that the users are doing the right thing and treat alias names (which eventually end up being pathname components) as bytes, and everything should be happy, even on macOS.