{"thread":{"id":"47702","subject":"Cloned repository has file changes -> bug?","startedAt":"2018-01-27T19:42:21Z","lastAt":"2018-02-06T14:36:11Z","messageCount":10,"participants":["Filip Jorissen","Ævar Arnfjörð Bjarmason","Torsten Bögershausen","brian m. carlson","Duy Nguyen","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"337579","messageId":"BCFDB3A3-B515-4932-AC67-F720AEB4B0BE@kuleuven.be","threadId":"47702","inReplyTo":null,"subject":"Cloned repository has file changes -> bug?","fromName":"Filip Jorissen","fromEmail":"filip.jorissen@kuleuven.be","sentAt":"2018-01-27T19:35:49Z","receivedAt":"2018-01-27T19:42:21Z","isPatch":false,"sender":{"key":"filip.jorissen@kuleuven.be","avatar":null},"body":"Dear all,\n\nI think our git repository is bugged. The reason why I say this is the following. When cloning the repository, the newly cloned repository immediately has file changes. Steps to reproduce and illustration is at the end of this email. Git checkout does not work to remove the file changes. This behavior seems to be reproducible across multiple computers. Is this a bug? How can I fix the repository?\n\nThanks in advance for the support!\n\nFilip\n\n\nMacBook-Pro-van-Filip:git filip$ git clone git@github.com:open-ideas/IDEAS.git\nCloning into 'IDEAS'...\nremote: Counting objects: 48419, done.\nremote: Compressing objects: 100% (198/198), done.\nremote: Total 48419 (delta 134), reused 217 (delta 97), pack-reused 48108\nReceiving objects: 100% (48419/48419), 42.32 MiB | 1.81 MiB/s, done.\nResolving deltas: 100% (32847/32847), done.\nMacBook-Pro-van-Filip:git filip$ cd IDEAS\nMacBook-Pro-van-Filip:IDEAS filip$ git status\nOn branch master\nYour branch is up to date with 'origin/master'.\n\nChanges not staged for commit:\n  (use \"git add <file>...\" to update what will be committed)\n  (use \"git checkout -- <file>...\" to discard changes in working directory)\n\n\tmodified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n\tmodified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Utilities_Psychrometrics_Functions_Examples_SaturationPressure.txt\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n"},{"id":"337580","messageId":"87607nvzrd.fsf@evledraar.gmail.com","threadId":"47702","inReplyTo":"BCFDB3A3-B515-4932-AC67-F720AEB4B0BE@kuleuven.be","subject":"Re: Cloned repository has file changes -> bug?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-01-27T19:59:50Z","receivedAt":"2018-01-27T19:59:57Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sat, Jan 27 2018, Filip Jorissen jotted:\n\n> I think our git repository is bugged. The reason why I say this is the\n> following. When cloning the repository, the newly cloned repository\n> immediately has file changes[...].\n\nIf you run this:\n\n    git ls-files | tr '[:upper:]' '[:lower:]' | sort | uniq -D | grep '^'\n\nYou'll see that the reason is that you have files that differ only in\ncase.\n\nYou are using a Mac, and Macs by default think that files that are\ndifferent binary strings are the same file, since they don't consider\ncase to be relevant. The file FOO, foo and FoO and fOo are all the same\nfile as far as your Mac is concerned, but would be 4 different files on\nLinux.\n\n> How can I fix the repository?\n\nYou could check it out on a OS that considers files that differ in case\nto be different files, e.g. on Linux, move them around, push it, and new\nclones should work on your Mac.\n\nAlternatively I hear that you can create a loopback case-sensitive FS\nimage on Macs.\n"},{"id":"337599","messageId":"20180128075731.GA17412@tor.lan","threadId":"47702","inReplyTo":"87607nvzrd.fsf@evledraar.gmail.com","subject":"Re: Cloned repository has file changes -> bug?","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2018-01-28T07:57:31Z","receivedAt":"2018-01-28T07:57:44Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Sat, Jan 27, 2018 at 08:59:50PM +0100, Ævar Arnfjörð Bjarmason wrote:\n> \n> On Sat, Jan 27 2018, Filip Jorissen jotted:\n> \n> > I think our git repository is bugged. The reason why I say this is the\n> > following. When cloning the repository, the newly cloned repository\n> > immediately has file changes[...].\n> \n> If you run this:\n> \n>     git ls-files | tr '[:upper:]' '[:lower:]' | sort | uniq -D | grep '^'\n> \n> You'll see that the reason is that you have files that differ only in\n> case.\n> \n> You are using a Mac, and Macs by default think that files that are\n> different binary strings are the same file, since they don't consider\n> case to be relevant. The file FOO, foo and FoO and fOo are all the same\n> file as far as your Mac is concerned, but would be 4 different files on\n> Linux.\n> \n> > How can I fix the repository?\n> \n> You could check it out on a OS that considers files that differ in case\n> to be different files, e.g. on Linux, move them around, push it, and new\n> clones should work on your Mac.\n> \n> Alternatively I hear that you can create a loopback case-sensitive FS\n> image on Macs.\n\nYou can even fix the repo locally.\nThere are 2 files with uppercase/lowercase collisions.\nI show you how to fix one off these, the other one goes similar.\nAfter that, do a commit and a push and pull request.\n\n\n\nChanges not staged for commit:\n  (use \"git add <file>...\" to update what will be committed)\n  (use \"git checkout -- <file>...\" to discard changes in working directory)\n\n        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Utilities_Psychrometrics_Functions_Examples_saturationPressure.txt\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\nuser@mac:/tmp/IDEAS> git ls-files -s | grep -i IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n100644 f56cfcf14aa4b53dfc5ecfb488366f721c94c8e2 0       IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n100644 e345e1372111d034b4c5a1c75eb791340b93f55e 0       IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\nuser@mac:/tmp/IDEAS> git mv IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\nuser@mac:/tmp/IDEAS> git checkout  IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\nuser@mac:/tmp/IDEAS> git checkout IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\nuser@mac:/tmp/IDEAS> git status\nOn branch master\nYour branch is up to date with 'origin/master'.\n\nChanges to be committed:\n  (use \"git reset HEAD <file>...\" to unstage)\n\n        renamed:    IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt -> IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\n\nChanges not staged for commit:\n  (use \"git add <file>...\" to update what will be committed)\n  (use \"git checkout -- <file>...\" to discard changes in working directory)\n\n        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Utilities_Psychrometrics_Functions_Examples_saturationPressure.txt\n\nuser@mac:/tmp/IDEAS>\n"},{"id":"337607","messageId":"20180128152822.GF431130@genre.crustytoothpaste.net","threadId":"47702","inReplyTo":"BCFDB3A3-B515-4932-AC67-F720AEB4B0BE@kuleuven.be","subject":"Re: Cloned repository has file changes -> bug?","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-01-28T15:28:22Z","receivedAt":"2018-01-28T15:28:32Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Sat, Jan 27, 2018 at 07:35:49PM +0000, Filip Jorissen wrote:\n> I think our git repository is bugged. The reason why I say this is the following. When cloning the repository, the newly cloned repository immediately has file changes. Steps to reproduce and illustration is at the end of this email. Git checkout does not work to remove the file changes. This behavior seems to be reproducible across multiple computers. Is this a bug? How can I fix the repository?\n> \n> Changes not staged for commit:\n>   (use \"git add <file>...\" to update what will be committed)\n>   (use \"git checkout -- <file>...\" to discard changes in working directory)\n> \n> \tmodified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n> \tmodified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Utilities_Psychrometrics_Functions_Examples_SaturationPressure.txt\n\nThis repository has multiple files that differ only in case.  I take it\nfrom your hostname that you're on a Mac, and by default macOS uses a\ncase-insensitive file system.\n\nSince the two files aren't identical, one or the other will show as\nmodified.  You probably want to adjust the repository so that it doesn't\nhave files differing only in case or use a case-sensitive file system.\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\nhttps://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"338506","messageId":"CD3563ED-5E0D-4238-A664-4F2335598FE2@kuleuven.be","threadId":"47702","inReplyTo":"20180128075731.GA17412@tor.lan","subject":"Re: Cloned repository has file changes -> bug?","fromName":"Filip Jorissen","fromEmail":"filip.jorissen@kuleuven.be","sentAt":"2018-02-06T13:09:23Z","receivedAt":"2018-02-06T13:09:42Z","isPatch":false,"sender":{"key":"filip.jorissen@kuleuven.be","avatar":null},"body":"Hi all,\n\nThank you for your quick responses. I was able to resolve the problem based on your feedback!\n\nBased on this experience, I would like to suggest that git is somehow able to avoid these problems by doing a case check itself rather than relying on the host OS for this? \n\nKind regards!\n\nFilip\n\n\n\n> Op 28 jan. 2018, om 08:57 heeft Torsten Bögershausen <tboegi@web.de> het volgende geschreven:\n> \n> On Sat, Jan 27, 2018 at 08:59:50PM +0100, Ævar Arnfjörð Bjarmason wrote:\n>> \n>> On Sat, Jan 27 2018, Filip Jorissen jotted:\n>> \n>>> I think our git repository is bugged. The reason why I say this is the\n>>> following. When cloning the repository, the newly cloned repository\n>>> immediately has file changes[...].\n>> \n>> If you run this:\n>> \n>>    git ls-files | tr '[:upper:]' '[:lower:]' | sort | uniq -D | grep '^'\n>> \n>> You'll see that the reason is that you have files that differ only in\n>> case.\n>> \n>> You are using a Mac, and Macs by default think that files that are\n>> different binary strings are the same file, since they don't consider\n>> case to be relevant. The file FOO, foo and FoO and fOo are all the same\n>> file as far as your Mac is concerned, but would be 4 different files on\n>> Linux.\n>> \n>>> How can I fix the repository?\n>> \n>> You could check it out on a OS that considers files that differ in case\n>> to be different files, e.g. on Linux, move them around, push it, and new\n>> clones should work on your Mac.\n>> \n>> Alternatively I hear that you can create a loopback case-sensitive FS\n>> image on Macs.\n> \n> You can even fix the repo locally.\n> There are 2 files with uppercase/lowercase collisions.\n> I show you how to fix one off these, the other one goes similar.\n> After that, do a commit and a push and pull request.\n> \n> \n> \n> Changes not staged for commit:\n>  (use \"git add <file>...\" to update what will be committed)\n>  (use \"git checkout -- <file>...\" to discard changes in working directory)\n> \n>        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n>        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Utilities_Psychrometrics_Functions_Examples_saturationPressure.txt\n> \n> no changes added to commit (use \"git add\" and/or \"git commit -a\")\n> user@mac:/tmp/IDEAS> git ls-files -s | grep -i IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n> 100644 f56cfcf14aa4b53dfc5ecfb488366f721c94c8e2 0       IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n> 100644 e345e1372111d034b4c5a1c75eb791340b93f55e 0       IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n> user@mac:/tmp/IDEAS> git mv IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\n> user@mac:/tmp/IDEAS> git checkout  IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\n> user@mac:/tmp/IDEAS> git checkout IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n> user@mac:/tmp/IDEAS> git status\n> On branch master\n> Your branch is up to date with 'origin/master'.\n> \n> Changes to be committed:\n>  (use \"git reset HEAD <file>...\" to unstage)\n> \n>        renamed:    IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt -> IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\n> \n> Changes not staged for commit:\n>  (use \"git add <file>...\" to update what will be committed)\n>  (use \"git checkout -- <file>...\" to discard changes in working directory)\n> \n>        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Utilities_Psychrometrics_Functions_Examples_saturationPressure.txt\n> \n> user@mac:/tmp/IDEAS>\n\n"},{"id":"338507","messageId":"CACsJy8A-KCzMCK34w_qNOQH2urwoQ-NmFZ+iR6Hyc3TQjGz1fg@mail.gmail.com","threadId":"47702","inReplyTo":"CD3563ED-5E0D-4238-A664-4F2335598FE2@kuleuven.be","subject":"Re: Cloned repository has file changes -> bug?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-02-06T13:19:22Z","receivedAt":"2018-02-06T13:20:04Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Feb 6, 2018 at 8:09 PM, Filip Jorissen\n<filip.jorissen@kuleuven.be> wrote:\n> Hi all,\n>\n> Thank you for your quick responses. I was able to resolve the problem based on your feedback!\n>\n> Based on this experience, I would like to suggest that git is somehow able to avoid these problems by doing a case check itself rather than relying on the host OS for this?\n\nGit itself can't resolve the problem. Case checking is just a side\nproblem. You have two paths, only one of which can be checked out by\nyour OS. How can Git know which one to checkout?\n\nGit could pick one at random and hide the other (using sparse\ncheckout, behind the scene). But that can still surprise the user \"how\ncome I see this content (of file \"AAA\") while the other user see\nanother content (of file \"aaa\")?\"\n\nI don't see a good solution for this. I think the best we could do is\nwarn earlier at clone time \"trouble ahead! Your repository and your OS\ndon't like each other!\" so that users won't get puzzled at \"git\nstatus\" later. Would that help?\n\n> Kind regards!\n>\n> Filip\n-- \nDuy\n"},{"id":"338508","messageId":"87lgg6l08m.fsf@evledraar.gmail.com","threadId":"47702","inReplyTo":"CD3563ED-5E0D-4238-A664-4F2335598FE2@kuleuven.be","subject":"Re: Cloned repository has file changes -> bug?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-02-06T13:24:25Z","receivedAt":"2018-02-06T13:24:39Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Feb 06 2018, Filip Jorissen jotted:\n\n> Hi all,\n>\n> Thank you for your quick responses. I was able to resolve the problem based on your feedback!\n>\n> Based on this experience, I would like to suggest that git is somehow able to avoid these problems by doing a case check itself rather than relying on the host OS for this?\n\nI think it would make a lot of sense for git to ship with some standard\nlibrary of hooks for people to enable that covered common cases like\nthat.\n\nBut it's important to realize that:\n\n 1) That's all this would be, this check would just be something you can\n    do via a pre-receive hook now (or in this case, that big hosting\n    providers like Github could offer as a pre-receive hook).\n\n 2) Case collisions are just a subset of these issues, if you look at my\n    CACBZZX4qH-w3YevoaW8RXAoFrjpfGerLWpBhetrO2tV-FGr3cQ@mail.gmail.com\n    here on-list you'll see an issue relating to unicode normalizing\n    that triggers a similar problem.\n\n 3) Such hooks slow down pushes, especially on big repos, you can\n    optimize things a bit (e.g. only look in the same directories), but\n    pathologically you end up needing to compare the cross-product of\n    changed files v.s. all existing files for each changed file.\n\n 4) It's not something hosting providers like Github, Gitlab etc. can\n    just enable, because some people want it like this. There's a lot of\n    repos that have e.g. case collisions or other problems that only\n    manifest on some OS-specific limitation (e.g. paths that are too\n    long for VMS), and none of the users care because they don't use the\n    repo on those systems.\n\n    So it's not something that can be enabled by default, even for the\n    most common case of case collisions.\n\nRight now you're probably best off setting up a CI check on Github that\nchecks whether someone commits a colliding file, and poking Github about\nmaybe providing some opt-in feature to check for this.\n\nI think the most performant way of checking this is:\n\n    git --icase-pathspecs ls-files -- <changed files>\n\nWhich should never emit more lines than you give to it, you'd run that\neither for the tip of the push, or if you want to be more thorough for\neach pushed commit.\n\nIf someone can think of a better way to check for this I'd love to hear\nabout it, I'll probably add a check like this to some of our internal\nrepos soon. We semi-regularly have Mac users up in arms because someone\npushed a case-colliding file on Linux.\n\n>> Op 28 jan. 2018, om 08:57 heeft Torsten Bögershausen <tboegi@web.de> het volgende geschreven:\n>>\n>> On Sat, Jan 27, 2018 at 08:59:50PM +0100, Ævar Arnfjörð Bjarmason wrote:\n>>>\n>>> On Sat, Jan 27 2018, Filip Jorissen jotted:\n>>>\n>>>> I think our git repository is bugged. The reason why I say this is the\n>>>> following. When cloning the repository, the newly cloned repository\n>>>> immediately has file changes[...].\n>>>\n>>> If you run this:\n>>>\n>>>    git ls-files | tr '[:upper:]' '[:lower:]' | sort | uniq -D | grep '^'\n>>>\n>>> You'll see that the reason is that you have files that differ only in\n>>> case.\n>>>\n>>> You are using a Mac, and Macs by default think that files that are\n>>> different binary strings are the same file, since they don't consider\n>>> case to be relevant. The file FOO, foo and FoO and fOo are all the same\n>>> file as far as your Mac is concerned, but would be 4 different files on\n>>> Linux.\n>>>\n>>>> How can I fix the repository?\n>>>\n>>> You could check it out on a OS that considers files that differ in case\n>>> to be different files, e.g. on Linux, move them around, push it, and new\n>>> clones should work on your Mac.\n>>>\n>>> Alternatively I hear that you can create a loopback case-sensitive FS\n>>> image on Macs.\n>>\n>> You can even fix the repo locally.\n>> There are 2 files with uppercase/lowercase collisions.\n>> I show you how to fix one off these, the other one goes similar.\n>> After that, do a commit and a push and pull request.\n>>\n>>\n>>\n>> Changes not staged for commit:\n>>  (use \"git add <file>...\" to update what will be committed)\n>>  (use \"git checkout -- <file>...\" to discard changes in working directory)\n>>\n>>        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n>>        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Utilities_Psychrometrics_Functions_Examples_saturationPressure.txt\n>>\n>> no changes added to commit (use \"git add\" and/or \"git commit -a\")\n>> user@mac:/tmp/IDEAS> git ls-files -s | grep -i IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n>> 100644 f56cfcf14aa4b53dfc5ecfb488366f721c94c8e2 0       IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n>> 100644 e345e1372111d034b4c5a1c75eb791340b93f55e 0       IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n>> user@mac:/tmp/IDEAS> git mv IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\n>> user@mac:/tmp/IDEAS> git checkout  IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\n>> user@mac:/tmp/IDEAS> git checkout IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt\n>> user@mac:/tmp/IDEAS> git status\n>> On branch master\n>> Your branch is up to date with 'origin/master'.\n>>\n>> Changes to be committed:\n>>  (use \"git reset HEAD <file>...\" to unstage)\n>>\n>>        renamed:    IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump.txt -> IDEAS/Resources/ReferenceResults/Dymola/ideas_Fluid_HeatExchangers_GroundHeatExchangers_Borefield_Examples_MultipleBoreholesWithHeatPump2.txt\n>>\n>> Changes not staged for commit:\n>>  (use \"git add <file>...\" to update what will be committed)\n>>  (use \"git checkout -- <file>...\" to discard changes in working directory)\n>>\n>>        modified:   IDEAS/Resources/ReferenceResults/Dymola/IDEAS_Utilities_Psychrometrics_Functions_Examples_saturationPressure.txt\n>>\n>> user@mac:/tmp/IDEAS>\n"},{"id":"338510","messageId":"20180206141423.GA28721@sigill.intra.peff.net","threadId":"47702","inReplyTo":"87lgg6l08m.fsf@evledraar.gmail.com","subject":"Re: Cloned repository has file changes -> bug?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-02-06T14:14:23Z","receivedAt":"2018-02-06T14:14:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 06, 2018 at 02:24:25PM +0100, Ævar Arnfjörð Bjarmason wrote:\n\n>  3) Such hooks slow down pushes, especially on big repos, you can\n>     optimize things a bit (e.g. only look in the same directories), but\n>     pathologically you end up needing to compare the cross-product of\n>     changed files v.s. all existing files for each changed file.\n\nI think you could just complain about any tree that contains entries\nthat have duplicate entries after normalization. I.e.:\n\n  git rev-list --objects $new --not $old |\n  awk '{print $1}' |\n  git cat-file --batch-check='%(objecttype) %(objectname)' |\n  awk '/^tree/ {print $2}'|\n  while read tree; do\n\tdups=$(git ls-tree $tree | cut -f 2- | tr A-Z a-z | sort | uniq -d)\n\ttest -z \"$dups\" || echo \"$tree has duplicates: $dups\"\n  done\n\nThat gives reasonable algorithmic complexity, but of course the shell\nimplementation is horrific. One could imagine that this could be\nimplemented as part of fsck_tree(), though, which is already reading\nthrough all the entries (unfortunately it requires auxiliary storage\nlinear with the size of a given tree object, but that's not too bad).\n\nBut it would probably need:\n\n  1. To be enabled as an optional fsck warning, possibly even defaulting\n     to \"ignore\".\n\n  2. That \"tr\" could be any arbitrary transformation. Case-folding is\n     the obvious one, but in theory you could match the normalization\n     behavior of certain popular filesystems.\n\nI'm not entirely convinced it's worth all of this effort, but I think it\nwould be _possible_ at least.\n\n-Peff\n"},{"id":"338511","messageId":"5C27A062-A03B-4A4B-978E-40CFD78FC1AB@kuleuven.be","threadId":"47702","inReplyTo":"20180206141423.GA28721@sigill.intra.peff.net","subject":"Re: Cloned repository has file changes -> bug?","fromName":"Filip Jorissen","fromEmail":"filip.jorissen@kuleuven.be","sentAt":"2018-02-06T14:30:41Z","receivedAt":"2018-02-06T14:30:57Z","isPatch":false,"sender":{"key":"filip.jorissen@kuleuven.be","avatar":null},"body":"I’m not git expert but, from a user point of view, the following would make sense. When adding a file, git could check whether a different file is already in the repository with the same name (case-insensitive check). Then simply report that this may be a mistake and request to use ‘git add -f’ to force the ‘add’. Perhaps this coincides with what was suggested in earlier replies. From my point of view the check should be enabled by default, but it could be optional too. \n\nFilip\n\n\n\n> Op 6 feb. 2018, om 15:14 heeft Jeff King <peff@peff.net> het volgende geschreven:\n> \n> On Tue, Feb 06, 2018 at 02:24:25PM +0100, Ævar Arnfjörð Bjarmason wrote:\n> \n>> 3) Such hooks slow down pushes, especially on big repos, you can\n>>    optimize things a bit (e.g. only look in the same directories), but\n>>    pathologically you end up needing to compare the cross-product of\n>>    changed files v.s. all existing files for each changed file.\n> \n> I think you could just complain about any tree that contains entries\n> that have duplicate entries after normalization. I.e.:\n> \n>  git rev-list --objects $new --not $old |\n>  awk '{print $1}' |\n>  git cat-file --batch-check='%(objecttype) %(objectname)' |\n>  awk '/^tree/ {print $2}'|\n>  while read tree; do\n> \tdups=$(git ls-tree $tree | cut -f 2- | tr A-Z a-z | sort | uniq -d)\n> \ttest -z \"$dups\" || echo \"$tree has duplicates: $dups\"\n>  done\n> \n> That gives reasonable algorithmic complexity, but of course the shell\n> implementation is horrific. One could imagine that this could be\n> implemented as part of fsck_tree(), though, which is already reading\n> through all the entries (unfortunately it requires auxiliary storage\n> linear with the size of a given tree object, but that's not too bad).\n> \n> But it would probably need:\n> \n>  1. To be enabled as an optional fsck warning, possibly even defaulting\n>     to \"ignore\".\n> \n>  2. That \"tr\" could be any arbitrary transformation. Case-folding is\n>     the obvious one, but in theory you could match the normalization\n>     behavior of certain popular filesystems.\n> \n> I'm not entirely convinced it's worth all of this effort, but I think it\n> would be _possible_ at least.\n> \n> -Peff\n\n"},{"id":"338512","messageId":"xmqqinba89tb.fsf@gitster-ct.c.googlers.com","threadId":"47702","inReplyTo":"20180206141423.GA28721@sigill.intra.peff.net","subject":"Re: Cloned repository has file changes -> bug?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-02-06T14:36:00Z","receivedAt":"2018-02-06T14:36:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I'm not entirely convinced it's worth all of this effort, but I think it\n> would be _possible_ at least.\n\nI thought that the original poster wants to have a knob that the\nproject can ask its participants to enable in their clones of the\nrepository that wars this situation when they \"git add\".  When a\nprojects considers that macOS users must dictate the world order\nbecause its source must be checked out on case insensitive HFS+, it\nmay be sensible to force participants on other platforms whose\nfilesystem does not guarantee that two paths that \"normalize\" to the\nsame string will not enter in the project history to spend\napplication cycles to do so instead.\n\nThat admittedly is quite a macOS centric view, and it is not a very\npleasant one, as it means almost all individual _applications_ on\nother platforms that conceivably could be used to work on a project\nmacOS folks would want to be treated as first-class citizens would\nneed to learn about the peculiar filesystem limitation of one\nparticular platform they otherwise may not necessarily care about.\n\n"}]}