summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff-tree_--root_-r_initial
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-04-28 12:16:31 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-04-29 09:59:44 -0700
commit750b2e4785e5956122b3c565af65eb1929714fba (patch)
tree89cb9ed48bde15399ffe8619f7909259e861ab52 /t/t4013/diff.diff-tree_--root_-r_initial
parentGit 1.9.2 (diff)
downloadtgif-750b2e4785e5956122b3c565af65eb1929714fba.tar.xz
t3910: show failure of core.precomposeunicode with decomposed filenames
If you have existing decomposed filenames in your git repository (e.g., that were created with older versions of git that did not precompose unicode), a modern git with core.precomposeunicode set does not handle them well. The problem is that we normalize the paths coming from the disk into their precomposed form, and then compare them against the literal bytes in the index. This makes things better if you have the precomposed form in the index. It makes things worse if you actually have the decomposed form in the index. As a result, paths with decomposed filenames may have their precomposed variants listed as untracked files (even though the precomposed variants do not exist on-disk at all). This patch just adds a test to demonstrate the breakage. Some possible fixes are: 1. Tell everyone that NFD in the git repo is wrong, and they should make a new commit to normalize all their in-repo files to be precomposed. This is probably not the right thing to do, because it still doesn't fix checkouts of old history. And it spreads the problem to people on byte-preserving filesystems (like ext4), because now they have to start precomposing their filenames as they are adde to git. 2. Do all index filename comparisons using a UTF-8 aware comparison function when core.precomposeunicode is set. This would probably have bad performance, and somewhat defeats the point of converting the filenames at the readdir level in the first place. 3. Convert index filenames to their precomposed form when we read the index from disk. This would be efficient, but we would have to be careful not to write the precomposed forms back out to disk. 4. Introduce some infrastructure to efficiently match up the precomposed/decomposed forms. We already do something similar for case-insensitive files using name-hash.c. We might be able to adapt that strategy here. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff-tree_--root_-r_initial')
0 files changed, 0 insertions, 0 deletions