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

Re: icase pathspec magic support in ls-tree

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 2, 2022, 19:07 UTC
Message-ID
<YznhYzWztkPc9pJk@tapette.crustytoothpaste.net>
In-Reply-To
<220930.86r0ztufwd.gmgdl@evledraar.gmail.com>
On 2022-09-30 at 13:53:16, Ævar Arnfjörð Bjarmason wrote:
Show 5 quoted lines
> You might find ASCII-only sufficient, but note that even if you get this
> working you won't catch the more complex Unicode normalization rules
> various filesystems perform, see the fsck code we carefully crafted to
> make sure we don't get something those FS's will mistake for a ".git"
> directory in-tree.

What's even worse is that different OSes case-fold differently and the behaviour differs based on the version of the OS that formatted the file system (which is of course not exposed to userspace), so in general it's impossible to know exactly how case folding works on a particular system.

It might be possible to implement some general rules that are overzealous (in that they will catch patterns that will case-fold on _some_ system), but in general this is very difficult. The rules will also almost certainly change with newer versions of Unicode.

I'll also point out that there is no locale-independent way to correctly case-fold Unicode text. Correct case-folding is sensitive to the language, script, and region.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Ævar Arnfjörð BjarmasonNext: Tao Klerks
Message 3 of 16 in “icase pathspec magic support in ls-tree”
  1. Tao KlerksSep 30, 2022
  2. Ævar Arnfjörð BjarmasonSep 30, 2022
  3. brian m. carlsonOct 2, 2022
  4. Tao KlerksOct 13, 2022
  5. Torsten BögershausenOct 14, 2022
  6. Tao KlerksOct 14, 2022
  7. Erik Cervin EdinOct 14, 2022
  8. Elijah NewrenOct 14, 2022
  9. Erik Cervin EdinOct 14, 2022
  10. Tao KlerksOct 14, 2022
  11. Tao KlerksOct 14, 2022
  12. Tao KlerksOct 14, 2022
  13. Erik Cervin EdinOct 14, 2022
  14. Elijah NewrenOct 14, 2022
  15. Tao KlerksOct 15, 2022
  16. Tao KlerksOct 17, 2022

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.