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

Re: [PATCH] t3910: show failure of core.precomposeunicode with decomposed filenames

From
Jeff King <peff@peff.net>
Date
Apr 29, 2014, 19:46 UTC
Message-ID
<20140429194654.GC11832@sigill.intra.peff.net>
In-Reply-To
<xmqqwqe8j7id.fsf@gitster.dls.corp.google.com>
On Tue, Apr 29, 2014 at 11:49:30AM -0700, Junio C Hamano wrote:
Show 14 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > I don't think we have a "str_utf8_cmp" that ignores normalizations (or
> > maybe strcoll will do this?). But in theory we could use it everywhere
> > we use strcasecmp for ignore_case. And then we would not need to have
> > our readdir wrapper, maybe? I admit I haven't thought that much about
> > _either_ approach. But aside from some bugs in the hash system, I do not
> > recall seeing any design problems in the ignorecase code.
> 
> Our diffs and merges depend on walking two (or more) sorted lists,
> and that sort order is baked in the tree objects when they are
> created.  Using "normalized comparison" only when comparing the
> earliest elements picked from these sorted lists would not give you
> the correct comparison or merge results, would it?

Right, but we do not do normalized comparisons on that side. Not for precompose, and not for ignorecase. The entry in the index _is_ case-sensitive[1], and we compare it as such to the tree side.

It is only when comparing the filesystem side to the index that we need to care about such normalizations. And there we have the name-hash code to handle ignorecase, but nothing to handle precompose.

-Peff
[1] This works because you typically get the case-sensitive entry via
    `git read-tree`, and then further update it from the filesystem. If
    you were to add a new entry "makefile", and somebody else added
    "Makefile", they would conflict.
    When you do "git add makefile" and "Makefile" _does_ exist, I am not
    sure, though, if it is git who handles making sure we find the
    correct entry, or if it is simply the fact that case insensitive
    filesystems are typically case-preserving (so you generally ask for
    "Makefile" anyway). If it is the latter, then that is a problem for
    precompose. HFS's NFD normalization is non-preserving.
Previous: Junio C HamanoNext: Torsten Bögershausen
Message 13 of 19 in “t3910: show failure of core.precomposeunicode with decomposed filenames”
  1. t3910: show failure of core.precomposeunicode with decomposed filenamesJeff King, Apr 28, 2014
  2. Junio C HamanoApr 28, 2014
  3. Jeff KingApr 28, 2014
  4. Torsten BögershausenApr 28, 2014
  5. Jeff KingApr 28, 2014
  6. Torsten BögershausenApr 28, 2014
  7. Jeff KingApr 29, 2014
  8. Torsten BögershausenApr 29, 2014
  9. Jeff KingApr 29, 2014
  10. Junio C HamanoApr 29, 2014
  11. Jeff KingApr 29, 2014
  12. Junio C HamanoApr 29, 2014
  13. Jeff KingApr 29, 2014
  14. Torsten BögershausenApr 30, 2014
  15. Torsten BögershausenMay 4, 2014
  16. Torsten BögershausenMay 4, 2014
  17. Jeff KingMay 5, 2014
  18. Erik Faye-LundMay 6, 2014
  19. Torsten BögershausenMay 7, 2014

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.