lenamonj commented on PR #443:
URL: https://github.com/apache/commons-codec/pull/443#issuecomment-5656767220

   None, and Git's object model enforces none either: a tree object stores the 
name bytes it was given, so the NFC and NFD spellings of one name are two 
entries with two different ids. On git 2.53.0 on Linux, `git mktree` accepts a 
tree holding both `caf\303\251` and `cafe\314\201`, `git fsck --strict` passes 
it, and `git write-tree` over a directory holding both files gives 
`79bc87b55119be79977a4f03942118bf8f06fadc`; `treeId` at 7ed2bae over the same 
directory gives the same id. The NFC that Google reports is 
`core.precomposeUnicode`, a macOS-only option: `compat/precompose_utf8.c` wraps 
`readdir` and converts every non-ASCII name to NFC through `iconv` before it 
reaches the index, and `git init` on macOS turns it on when the filesystem 
treats the two spellings as one file. So on a Mac, `git write-tree` hashes NFC 
names while `treeId` hashes the names as the JDK returns them, and the two 
agree there only for names that are already NFC. The Javadoc paragraph can 
carry both facts, tha
 t names are hashed with no normalization and that git's macOS build 
precomposes first, if you would like them spelled out.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to