{"thread":{"id":"46366","subject":"Git on macOS shows committed files as untracked","startedAt":"2017-07-12T22:31:25Z","lastAt":"2017-07-13T19:35:57Z","messageCount":4,"participants":["roeder.git@mailnull.com","Jeff King","Torsten Bögershausen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"324319","messageId":"20170712222128.A2F7A246E3@outside.256stuff.com","threadId":"46366","inReplyTo":null,"subject":"Git on macOS shows committed files as untracked","fromName":"","fromEmail":"roeder.git@mailnull.com","sentAt":"2017-07-12T22:21:28Z","receivedAt":"2017-07-12T22:31:25Z","isPatch":false,"sender":{"key":"roeder.git@mailnull.com","avatar":null},"body":"In Git on macOS (git version 2.13.2 | brew install git) the status command will show folders as untracked even though they are committed and checked out from the repository. Does not reproduce on Windows and Ubuntu.\n\nRepro steps:\n\n1. Download https://www.dropbox.com/s/0q5pbpqpckwzj7b/gitstatusrepro.zip?dl=0\n2. unzip gitstatusrepro.zip && cd gitstatusrepro\n3. git reset --hard\n\nHEAD is now at 95fcd7e add folder with unicode name\n\n4. git status\n\nOn branch master\nUntracked files:\n  (use \"git add <file>...\" to include in what will be committed)\n\n\t\"d\\314\\207\\316\\271\\314\\223\\314\\200\\342\\225\\223\\316\\265\\357\\256\\257\\360\\222\\221\\217\\342\\227\\213\\342\\225\\223\\320\\243\\314\\213/\"\n\nnothing added to commit but untracked files present (use \"git add\" to track)\n\n\n----------\nThis message was sent from a MailNull anti-spam account.  You can get\nyour free account and take control over your email by visiting the\nfollowing URL.\n\n   http://mailnull.com/\n"},{"id":"324322","messageId":"20170712231557.lu7ppj3bric2fahi@sigill.intra.peff.net","threadId":"46366","inReplyTo":"20170712222128.A2F7A246E3@outside.256stuff.com","subject":"Re: Git on macOS shows committed files as untracked","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-07-12T23:15:57Z","receivedAt":"2017-07-12T23:16:04Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 12, 2017 at 06:21:28PM -0400, roeder.git@mailnull.com wrote:\n\n> In Git on macOS (git version 2.13.2 | brew install git) the status\n> command will show folders as untracked even though they are committed\n> and checked out from the repository. Does not reproduce on Windows and\n> Ubuntu.\n> [...]\n> \n> \t\"d\\314\\207\\316\\271\\314\\223\\314\\200\\342\\225\\223\\316\\265\\357\\256\\257\\360\\222\\221\\217\\342\\227\\213\\342\\225\\223\\320\\243\\314\\213/\"\n\nProbably the issue has to do with Unicode normalization, and you have\nfiles in your repository that can't be represented on your filesystem.\nFor example, the first two code-points above are \"d\" followed by U+0307,\n\"COMBINING DOT ABOVE\". That pair can also be represented as U+1E0B,\n\"LATIN SMALL LETTER D WITH DOT ABOVE\".\n\nI don't recall which form HFS+ normalizes to, but basically what happens\nis that Git opens the file with some name, and the filesystem quietly\nrewrites that under the hood to a different, normalized name. Then when\nGit walks the directory later to ask which files are present, it sees\nthis other filename that it has no clue about.\n\nGenerally the solution is to commit the normalized name. There's some\nlogic inside Git to \"precompose\" names to the right normalization, but I\nthink that only affects new files you add. Existing committed files with\nthe wrong normalization run into this issue.\n\n-Peff\n"},{"id":"324346","messageId":"130b338b-2e77-65d6-a3fa-f272ac43b81c@web.de","threadId":"46366","inReplyTo":"20170712231557.lu7ppj3bric2fahi@sigill.intra.peff.net","subject":"Re: Git on macOS shows committed files as untracked","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2017-07-13T08:42:29Z","receivedAt":"2017-07-13T08:42:00Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\n\nOn 13/07/17 01:15, Jeff King wrote:\n> On Wed, Jul 12, 2017 at 06:21:28PM -0400, roeder.git@mailnull.com wrote:\n> \n>> In Git on macOS (git version 2.13.2 | brew install git) the status\n>> command will show folders as untracked even though they are committed\n>> and checked out from the repository. Does not reproduce on Windows and\n>> Ubuntu.\n>> [...]\n>>\n>> \t\"d\\314\\207\\316\\271\\314\\223\\314\\200\\342\\225\\223\\316\\265\\357\\256\\257\\360\\222\\221\\217\\342\\227\\213\\342\\225\\223\\320\\243\\314\\213/\"\n> \n> Probably the issue has to do with Unicode normalization, and you have\n> files in your repository that can't be represented on your filesystem.\n> For example, the first two code-points above are \"d\" followed by U+0307,\n> \"COMBINING DOT ABOVE\". That pair can also be represented as U+1E0B,\n> \"LATIN SMALL LETTER D WITH DOT ABOVE\".\n> \n> I don't recall which form HFS+ normalizes to, but basically what happens\n> is that Git opens the file with some name, and the filesystem quietly\n> rewrites that under the hood to a different, normalized name. Then when\n> Git walks the directory later to ask which files are present, it sees\n> this other filename that it has no clue about.\n> \n> Generally the solution is to commit the normalized name. There's some\n> logic inside Git to \"precompose\" names to the right normalization, but I\n> think that only affects new files you add. Existing committed files with\n> the wrong normalization run into this issue.\n> \n> -Peff\n> \nThanks for the fast analyzes -\nin short:\nwhat does\ngit -c core.precomposeunicode=true status\nsay ?\n\n\nThe easiest thing may be to set\ngit config --global core.precomposeunicode true\n\n\n"},{"id":"324424","messageId":"xmqq60eww2nd.fsf@gitster.mtv.corp.google.com","threadId":"46366","inReplyTo":"130b338b-2e77-65d6-a3fa-f272ac43b81c@web.de","subject":"Re: Git on macOS shows committed files as untracked","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-07-13T19:35:50Z","receivedAt":"2017-07-13T19:35:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> Thanks for the fast analyzes -\n> in short:\n> what does\n> git -c core.precomposeunicode=true status\n> say ?\n>\n> The easiest thing may be to set\n> git config --global core.precomposeunicode true\n\nGood suggestion.\n\nI learned a new thing today.  I somehow thought that precompose\ntrick was only about argv[] when a program starts up and did not\napply to paths readdir(3) finds through dir.c, e.g.\n\n    $ git add .\n\nBut apparently there is replacement readdir() used in compat/ for\nMacOSX so the paths from the system are also covered by the\nconfiguration.\n"}]}