{"thread":{"id":"31498","subject":"Git an case-insensitive Mac OS X filesystem","startedAt":"2012-09-11T09:21:16Z","lastAt":"2012-09-11T15:44:13Z","messageCount":10,"participants":["Roger Pau Monné","Tomas Carnecky","Erik Faye-Lund","Matthieu Moy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"198757","messageId":"CAPLaKK71O3RzavOqY2uVC1tUsbs+W6WxJRWuLBDFUvTwojAN-g@mail.gmail.com","threadId":"31498","inReplyTo":null,"subject":"Git an case-insensitive Mac OS X filesystem","fromName":"Roger Pau Monné","fromEmail":"roger.pau@entel.upc.edu","sentAt":"2012-09-11T09:21:16Z","receivedAt":"2012-09-11T09:21:16Z","isPatch":false,"sender":{"key":"roger.pau@entel.upc.edu","avatar":null},"body":"Hello,\n\nI'm using git for all my projects, and I usually work under Mac OS X\nwith the default filesystem (that's case-insensitive, but\ncase-preserving). I'm currently working on a project that has several\nbranches, and two of them are called origin/DHCPCD and origin/dhcpcd\nrespectively, that's unfortunate, but I cannot do anything about it.\nThis completely breaks the git repository, because\n.git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are\nactually the same file, so when I try to update my repository\nperforming a git pull I get the following error:\n\nerror: Ref refs/remotes/origin/dhcpcd is at\n6b371783de2def2d6e3ec2680ba731f7086067ee but expected\n79f701ce599a27043eed8343f76406014963278a\n\nSo I was wondering if anyone has stumbled upon this issue, and what's\nthe best approach to fix it.\n\nThanks, Roger.\n"},{"id":"198758","messageId":"CAPLaKK4Xm8KzQ8HcM_TbbuDr1hcLjhjSOWSyJS3jFX0toFBjsA@mail.gmail.com","threadId":"31498","inReplyTo":"1347355466-ner-6656@calvin","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Roger Pau Monné","fromEmail":"roger.pau@entel.upc.edu","sentAt":"2012-09-11T09:30:28Z","receivedAt":"2012-09-11T09:30:28Z","isPatch":false,"sender":{"key":"roger.pau@entel.upc.edu","avatar":null},"body":"On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky\n<tomas.carnecky@gmail.com> wrote:\n> On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné <roger.pau@entel.upc.edu> wrote:\n>> Hello,\n>>\n>> I'm using git for all my projects, and I usually work under Mac OS X\n>> with the default filesystem (that's case-insensitive, but\n>> case-preserving). I'm currently working on a project that has several\n>> branches, and two of them are called origin/DHCPCD and origin/dhcpcd\n>> respectively, that's unfortunate, but I cannot do anything about it.\n>> This completely breaks the git repository, because\n>> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are\n>> actually the same file, so when I try to update my repository\n>> performing a git pull I get the following error:\n>>\n>> error: Ref refs/remotes/origin/dhcpcd is at\n>> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected\n>> 79f701ce599a27043eed8343f76406014963278a\n>>\n>> So I was wondering if anyone has stumbled upon this issue, and what's\n>> the best approach to fix it.\n>\n> Make a disk image and format it with a case sensitive filesystem (use the Disk\n> Utility to do that). Do your work there.\n\nYes, I could also create a partition, or format my entire disk to\ncase-sensitive (although I heard it might break some OS X\napplications), I guess adding a workaround for this in git itself is\nnot appealing (like storing the branch file using a slightly different\nname?)\n"},{"id":"198759","messageId":"CAPabhsKrnFq3z6wTcZny+Jh1PF-7arx_r8WyNRHmgQUu=U4sig@mail.gmail.com","threadId":"31498","inReplyTo":"CAPLaKK4Xm8KzQ8HcM_TbbuDr1hcLjhjSOWSyJS3jFX0toFBjsA@mail.gmail.com","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Tomas Carnecky","fromEmail":"tomas.carnecky@gmail.com","sentAt":"2012-09-11T09:36:38Z","receivedAt":"2012-09-11T09:36:38Z","isPatch":false,"sender":{"key":"tomas.carnecky@gmail.com","avatar":null},"body":"On Tue, Sep 11, 2012 at 9:30 AM, Roger Pau Monné\n<roger.pau@entel.upc.edu> wrote:\n> On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky\n> <tomas.carnecky@gmail.com> wrote:\n>> On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné <roger.pau@entel.upc.edu> wrote:\n>>> Hello,\n>>>\n>>> I'm using git for all my projects, and I usually work under Mac OS X\n>>> with the default filesystem (that's case-insensitive, but\n>>> case-preserving). I'm currently working on a project that has several\n>>> branches, and two of them are called origin/DHCPCD and origin/dhcpcd\n>>> respectively, that's unfortunate, but I cannot do anything about it.\n>>> This completely breaks the git repository, because\n>>> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are\n>>> actually the same file, so when I try to update my repository\n>>> performing a git pull I get the following error:\n>>>\n>>> error: Ref refs/remotes/origin/dhcpcd is at\n>>> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected\n>>> 79f701ce599a27043eed8343f76406014963278a\n>>>\n>>> So I was wondering if anyone has stumbled upon this issue, and what's\n>>> the best approach to fix it.\n>>\n>> Make a disk image and format it with a case sensitive filesystem (use the Disk\n>> Utility to do that). Do your work there.\n>\n> Yes, I could also create a partition, or format my entire disk to\n> case-sensitive (although I heard it might break some OS X\n> applications), I guess adding a workaround for this in git itself is\n> not appealing (like storing the branch file using a slightly different\n> name?)\n\nNo, I'm not talking about a partition. I'm talking about a Mac OS X\ndisk image (eg. http://en.wikipedia.org/wiki/.dmg).\n"},{"id":"198760","messageId":"CAPLaKK6R=BNjgY8wc8nZzyPy53ppeO4bKN=Cum_+b6Kwb5F=SA@mail.gmail.com","threadId":"31498","inReplyTo":"CAPabhsKrnFq3z6wTcZny+Jh1PF-7arx_r8WyNRHmgQUu=U4sig@mail.gmail.com","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Roger Pau Monné","fromEmail":"roger.pau@entel.upc.edu","sentAt":"2012-09-11T09:44:02Z","receivedAt":"2012-09-11T09:44:02Z","isPatch":false,"sender":{"key":"roger.pau@entel.upc.edu","avatar":null},"body":"On Tue, Sep 11, 2012 at 10:36 AM, Tomas Carnecky\n<tomas.carnecky@gmail.com> wrote:\n> On Tue, Sep 11, 2012 at 9:30 AM, Roger Pau Monné\n> <roger.pau@entel.upc.edu> wrote:\n>> On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky\n>> <tomas.carnecky@gmail.com> wrote:\n>>> On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné <roger.pau@entel.upc.edu> wrote:\n>>>> Hello,\n>>>>\n>>>> I'm using git for all my projects, and I usually work under Mac OS X\n>>>> with the default filesystem (that's case-insensitive, but\n>>>> case-preserving). I'm currently working on a project that has several\n>>>> branches, and two of them are called origin/DHCPCD and origin/dhcpcd\n>>>> respectively, that's unfortunate, but I cannot do anything about it.\n>>>> This completely breaks the git repository, because\n>>>> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are\n>>>> actually the same file, so when I try to update my repository\n>>>> performing a git pull I get the following error:\n>>>>\n>>>> error: Ref refs/remotes/origin/dhcpcd is at\n>>>> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected\n>>>> 79f701ce599a27043eed8343f76406014963278a\n>>>>\n>>>> So I was wondering if anyone has stumbled upon this issue, and what's\n>>>> the best approach to fix it.\n>>>\n>>> Make a disk image and format it with a case sensitive filesystem (use the Disk\n>>> Utility to do that). Do your work there.\n>>\n>> Yes, I could also create a partition, or format my entire disk to\n>> case-sensitive (although I heard it might break some OS X\n>> applications), I guess adding a workaround for this in git itself is\n>> not appealing (like storing the branch file using a slightly different\n>> name?)\n>\n> No, I'm not talking about a partition. I'm talking about a Mac OS X\n> disk image (eg. http://en.wikipedia.org/wiki/.dmg).\n\nI understood this, it's just that I would prefer to avoid doing this\nkind if things, I would prefer to be able to work natively on my\nfilesystem, but it seems like there's no other option.\n\nThanks, Roger.\n"},{"id":"198761","messageId":"CABPQNSYv1hd8RFHfcQ1XTB94nu6xo+tjj4CvWur29152z2dk6A@mail.gmail.com","threadId":"31498","inReplyTo":"CAPLaKK71O3RzavOqY2uVC1tUsbs+W6WxJRWuLBDFUvTwojAN-g@mail.gmail.com","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-09-11T10:06:04Z","receivedAt":"2012-09-11T10:06:04Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Sep 11, 2012 at 11:21 AM, Roger Pau Monné\n<roger.pau@entel.upc.edu> wrote:\n> Hello,\n>\n> I'm using git for all my projects, and I usually work under Mac OS X\n> with the default filesystem (that's case-insensitive, but\n> case-preserving). I'm currently working on a project that has several\n> branches, and two of them are called origin/DHCPCD and origin/dhcpcd\n> respectively, that's unfortunate, but I cannot do anything about it.\n> This completely breaks the git repository, because\n> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are\n> actually the same file, so when I try to update my repository\n> performing a git pull I get the following error:\n>\n> error: Ref refs/remotes/origin/dhcpcd is at\n> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected\n> 79f701ce599a27043eed8343f76406014963278a\n>\n> So I was wondering if anyone has stumbled upon this issue, and what's\n> the best approach to fix it.\n>\n\nI have stumbled upon a similar issue on Windows (which also has a\ncase-preserving filesystem), and I seem to remember the solution being\nsomething to do with packed refs.\n\nPerhaps we could change Git to detect name-collisions and\nautomatically pack the refs in such cases?\n"},{"id":"198762","messageId":"vpq392og8fg.fsf@bauges.imag.fr","threadId":"31498","inReplyTo":"CABPQNSYv1hd8RFHfcQ1XTB94nu6xo+tjj4CvWur29152z2dk6A@mail.gmail.com","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2012-09-11T10:28:35Z","receivedAt":"2012-09-11T10:28:35Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Erik Faye-Lund <kusmabite@gmail.com> writes:\n\n> I have stumbled upon a similar issue on Windows (which also has a\n> case-preserving filesystem), and I seem to remember the solution being\n> something to do with packed refs.\n\nPacked-refs use a format like this:\n\n$ tail -3 .git/packed-refs\ne94214ce4b8acefce06d4ea37b76ac0de11ecb2d refs/tags/v1.7.9.5\nbf68fe0313c833fa62755176f6e24988ef7cf80f refs/tags/v1.7.9.6\n3996bb24c84013ec9ce9fa0980ce61f9ef97be4d refs/tags/v1.7.9.7\n\nso the ref name is stored within the file, not as the file name. So,\nyes, packing refs (done by \"git pack-refs\", called by \"git gc\" among\nother things) should solve case-insensitive issues.\n\nHowever, creating or updating refs after a pack will still create\nunpacked refs, so this solves the issue only if one of the colliding\nbranches is not updated anymore.\n\n> Perhaps we could change Git to detect name-collisions and\n> automatically pack the refs in such cases?\n\nThat's a bit harder than it seems, as the idea is to avoid re-writting\nthe packed-refs file for each ref update. Repacking after each colliding\nref update could be costly in terms of performance.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"198766","messageId":"CABPQNSZznFvjCLR7A7sACf9NcESek7DmOeJcSSHFY1cGHwD2Jg@mail.gmail.com","threadId":"31498","inReplyTo":"vpq392og8fg.fsf@bauges.imag.fr","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-09-11T11:18:29Z","receivedAt":"2012-09-11T11:18:29Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Sep 11, 2012 at 12:28 PM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Erik Faye-Lund <kusmabite@gmail.com> writes:\n>\n>> I have stumbled upon a similar issue on Windows (which also has a\n>> case-preserving filesystem), and I seem to remember the solution being\n>> something to do with packed refs.\n>\n> Packed-refs use a format like this:\n>\n> $ tail -3 .git/packed-refs\n> e94214ce4b8acefce06d4ea37b76ac0de11ecb2d refs/tags/v1.7.9.5\n> bf68fe0313c833fa62755176f6e24988ef7cf80f refs/tags/v1.7.9.6\n> 3996bb24c84013ec9ce9fa0980ce61f9ef97be4d refs/tags/v1.7.9.7\n>\n> so the ref name is stored within the file, not as the file name. So,\n> yes, packing refs (done by \"git pack-refs\", called by \"git gc\" among\n> other things) should solve case-insensitive issues.\n>\n> However, creating or updating refs after a pack will still create\n> unpacked refs, so this solves the issue only if one of the colliding\n> branches is not updated anymore.\n>\n\nOf course. In my case, the colliding refs weren't fetched from the\nsame source IIRC.\n\n>> Perhaps we could change Git to detect name-collisions and\n>> automatically pack the refs in such cases?\n>\n> That's a bit harder than it seems, as the idea is to avoid re-writting\n> the packed-refs file for each ref update. Repacking after each colliding\n> ref update could be costly in terms of performance.\n\nYes, but being costly in terms of performance is IMO a lot better than\ncorrupting refs, which is what we currently do.\n\nAnd it should really only be costly in the case where there's actually\nsuch a cost, on a file system where such a collision can happen.\n"},{"id":"198768","messageId":"vpqsjaodco8.fsf@bauges.imag.fr","threadId":"31498","inReplyTo":"CABPQNSZznFvjCLR7A7sACf9NcESek7DmOeJcSSHFY1cGHwD2Jg@mail.gmail.com","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2012-09-11T11:25:11Z","receivedAt":"2012-09-11T11:25:11Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Erik Faye-Lund <kusmabite@gmail.com> writes:\n\n> Yes, but being costly in terms of performance is IMO a lot better than\n> corrupting refs, which is what we currently do.\n\nI'm not saying nothing should be done, but I'm not sure packed-refs are\nthe right solution in the long term. We already have the foo Vs foo/bar\nissue (discussed in the \"keeping reflog for deleted refs\" discussion). I\nthink the right way would be to re-think the way we map ref name to the\nfilesystem, with proper escaping of capitals, slashes, ...\n\nBut that's a rather big change to do (and I'm unlikely to be the one\nvolunteering for it :-( )\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"198785","messageId":"7vhar4k1o5.fsf@alter.siamese.dyndns.org","threadId":"31498","inReplyTo":"CAPLaKK71O3RzavOqY2uVC1tUsbs+W6WxJRWuLBDFUvTwojAN-g@mail.gmail.com","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-11T15:40:58Z","receivedAt":"2012-09-11T15:40:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Roger Pau Monné <roger.pau@entel.upc.edu> writes:\n\n> Hello,\n>\n> I'm using git for all my projects, and I usually work under Mac OS X\n> with the default filesystem (that's case-insensitive, but\n> case-preserving). I'm currently working on a project that has several\n> branches, and two of them are called origin/DHCPCD and origin/dhcpcd\n> respectively, that's unfortunate, but I cannot do anything about it.\n> This completely breaks the git repository, because\n> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are\n> actually the same file, so when I try to update my repository\n> performing a git pull I get the following error:\n>\n> error: Ref refs/remotes/origin/dhcpcd is at\n> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected\n> 79f701ce599a27043eed8343f76406014963278a\n>\n> So I was wondering if anyone has stumbled upon this issue, and what's\n> the best approach to fix it.\n\nIf \"several\" is manageably small, you can configure your refspecs to\nrename them, e.g.\n\n\t[remote \"origin\"]\n\t\turl = ...\n                fetch = +refs/heads/master:refs/remotes/origin/master\n                fetch = +refs/heads/dhcpcd:refs/remotes/origin/dhcpcd\n                fetch = +refs/heads/DHCPCD:refs/remotes/origin/dhcpcd-u\n\nwhich tells\n\n\t$ git fetch origin\n\nto use your remote tracking branch origin/dhcpcd-u to copy from\ntheir DHCPCD.  Then you can work on it the usual way.\n\n\t$ git checkout -b dhcpcd-u origin/dhcpcd-u\n        $ work work work\n\nFor pushing, you can rename it back in a similar way.\n\n        $ git push origin dhcpcd-u:DHCPCD\n\nwhich is a short-hand for\n\n        $ git push origin refs/heads/dhcpcd-u:refs/heads/DHCPCD\n"},{"id":"198786","messageId":"7va9wwk1iq.fsf@alter.siamese.dyndns.org","threadId":"31498","inReplyTo":"CAPLaKK6R=BNjgY8wc8nZzyPy53ppeO4bKN=Cum_+b6Kwb5F=SA@mail.gmail.com","subject":"Re: Git an case-insensitive Mac OS X filesystem","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-11T15:44:13Z","receivedAt":"2012-09-11T15:44:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Roger Pau Monné <roger.pau@entel.upc.edu> writes:\n\n> I understood this, it's just that I would prefer to avoid doing this\n> kind if things, I would prefer to be able to work natively on my\n> filesystem, but it seems like there's no other option.\n\nIf you are unwilling to keep both lowercase and uppercase separately\non your end, and if the other side (the project you are interacting\nwith) wants you to have both, then I do not think there is any way\nto resolve such conflict between you and your project.\n"}]}