* Git an case-insensitive Mac OS X filesystem @ 2012-09-11 9:21 Roger Pau Monné [not found] ` <1347355466-ner-6656@calvin> ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Roger Pau Monné @ 2012-09-11 9:21 UTC (permalink / raw) To: git Hello, I'm using git for all my projects, and I usually work under Mac OS X with the default filesystem (that's case-insensitive, but case-preserving). I'm currently working on a project that has several branches, and two of them are called origin/DHCPCD and origin/dhcpcd respectively, that's unfortunate, but I cannot do anything about it. This completely breaks the git repository, because .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are actually the same file, so when I try to update my repository performing a git pull I get the following error: error: Ref refs/remotes/origin/dhcpcd is at 6b371783de2def2d6e3ec2680ba731f7086067ee but expected 79f701ce599a27043eed8343f76406014963278a So I was wondering if anyone has stumbled upon this issue, and what's the best approach to fix it. Thanks, Roger. ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <1347355466-ner-6656@calvin>]
* Re: Git an case-insensitive Mac OS X filesystem [not found] ` <1347355466-ner-6656@calvin> @ 2012-09-11 9:30 ` Roger Pau Monné 2012-09-11 9:36 ` Tomas Carnecky 0 siblings, 1 reply; 10+ messages in thread From: Roger Pau Monné @ 2012-09-11 9:30 UTC (permalink / raw) To: Tomas Carnecky; +Cc: git On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky <tomas.carnecky@gmail.com> wrote: > On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné <roger.pau@entel.upc.edu> wrote: >> Hello, >> >> I'm using git for all my projects, and I usually work under Mac OS X >> with the default filesystem (that's case-insensitive, but >> case-preserving). I'm currently working on a project that has several >> branches, and two of them are called origin/DHCPCD and origin/dhcpcd >> respectively, that's unfortunate, but I cannot do anything about it. >> This completely breaks the git repository, because >> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are >> actually the same file, so when I try to update my repository >> performing a git pull I get the following error: >> >> error: Ref refs/remotes/origin/dhcpcd is at >> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected >> 79f701ce599a27043eed8343f76406014963278a >> >> So I was wondering if anyone has stumbled upon this issue, and what's >> the best approach to fix it. > > Make a disk image and format it with a case sensitive filesystem (use the Disk > Utility to do that). Do your work there. Yes, I could also create a partition, or format my entire disk to case-sensitive (although I heard it might break some OS X applications), I guess adding a workaround for this in git itself is not appealing (like storing the branch file using a slightly different name?) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Git an case-insensitive Mac OS X filesystem 2012-09-11 9:30 ` Roger Pau Monné @ 2012-09-11 9:36 ` Tomas Carnecky 2012-09-11 9:44 ` Roger Pau Monné 0 siblings, 1 reply; 10+ messages in thread From: Tomas Carnecky @ 2012-09-11 9:36 UTC (permalink / raw) To: Roger Pau Monné; +Cc: git On Tue, Sep 11, 2012 at 9:30 AM, Roger Pau Monné <roger.pau@entel.upc.edu> wrote: > On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky > <tomas.carnecky@gmail.com> wrote: >> On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné <roger.pau@entel.upc.edu> wrote: >>> Hello, >>> >>> I'm using git for all my projects, and I usually work under Mac OS X >>> with the default filesystem (that's case-insensitive, but >>> case-preserving). I'm currently working on a project that has several >>> branches, and two of them are called origin/DHCPCD and origin/dhcpcd >>> respectively, that's unfortunate, but I cannot do anything about it. >>> This completely breaks the git repository, because >>> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are >>> actually the same file, so when I try to update my repository >>> performing a git pull I get the following error: >>> >>> error: Ref refs/remotes/origin/dhcpcd is at >>> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected >>> 79f701ce599a27043eed8343f76406014963278a >>> >>> So I was wondering if anyone has stumbled upon this issue, and what's >>> the best approach to fix it. >> >> Make a disk image and format it with a case sensitive filesystem (use the Disk >> Utility to do that). Do your work there. > > Yes, I could also create a partition, or format my entire disk to > case-sensitive (although I heard it might break some OS X > applications), I guess adding a workaround for this in git itself is > not appealing (like storing the branch file using a slightly different > name?) No, I'm not talking about a partition. I'm talking about a Mac OS X disk image (eg. http://en.wikipedia.org/wiki/.dmg). ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Git an case-insensitive Mac OS X filesystem 2012-09-11 9:36 ` Tomas Carnecky @ 2012-09-11 9:44 ` Roger Pau Monné 2012-09-11 15:44 ` Junio C Hamano 0 siblings, 1 reply; 10+ messages in thread From: Roger Pau Monné @ 2012-09-11 9:44 UTC (permalink / raw) To: Tomas Carnecky; +Cc: git On Tue, Sep 11, 2012 at 10:36 AM, Tomas Carnecky <tomas.carnecky@gmail.com> wrote: > On Tue, Sep 11, 2012 at 9:30 AM, Roger Pau Monné > <roger.pau@entel.upc.edu> wrote: >> On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky >> <tomas.carnecky@gmail.com> wrote: >>> On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné <roger.pau@entel.upc.edu> wrote: >>>> Hello, >>>> >>>> I'm using git for all my projects, and I usually work under Mac OS X >>>> with the default filesystem (that's case-insensitive, but >>>> case-preserving). I'm currently working on a project that has several >>>> branches, and two of them are called origin/DHCPCD and origin/dhcpcd >>>> respectively, that's unfortunate, but I cannot do anything about it. >>>> This completely breaks the git repository, because >>>> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are >>>> actually the same file, so when I try to update my repository >>>> performing a git pull I get the following error: >>>> >>>> error: Ref refs/remotes/origin/dhcpcd is at >>>> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected >>>> 79f701ce599a27043eed8343f76406014963278a >>>> >>>> So I was wondering if anyone has stumbled upon this issue, and what's >>>> the best approach to fix it. >>> >>> Make a disk image and format it with a case sensitive filesystem (use the Disk >>> Utility to do that). Do your work there. >> >> Yes, I could also create a partition, or format my entire disk to >> case-sensitive (although I heard it might break some OS X >> applications), I guess adding a workaround for this in git itself is >> not appealing (like storing the branch file using a slightly different >> name?) > > No, I'm not talking about a partition. I'm talking about a Mac OS X > disk image (eg. http://en.wikipedia.org/wiki/.dmg). I understood this, it's just that I would prefer to avoid doing this kind if things, I would prefer to be able to work natively on my filesystem, but it seems like there's no other option. Thanks, Roger. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Git an case-insensitive Mac OS X filesystem 2012-09-11 9:44 ` Roger Pau Monné @ 2012-09-11 15:44 ` Junio C Hamano 0 siblings, 0 replies; 10+ messages in thread From: Junio C Hamano @ 2012-09-11 15:44 UTC (permalink / raw) To: Roger Pau Monné; +Cc: Tomas Carnecky, git Roger Pau Monné <roger.pau@entel.upc.edu> writes: > I understood this, it's just that I would prefer to avoid doing this > kind if things, I would prefer to be able to work natively on my > filesystem, but it seems like there's no other option. If you are unwilling to keep both lowercase and uppercase separately on your end, and if the other side (the project you are interacting with) wants you to have both, then I do not think there is any way to resolve such conflict between you and your project. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Git an case-insensitive Mac OS X filesystem 2012-09-11 9:21 Git an case-insensitive Mac OS X filesystem Roger Pau Monné [not found] ` <1347355466-ner-6656@calvin> @ 2012-09-11 10:06 ` Erik Faye-Lund 2012-09-11 10:28 ` Matthieu Moy 2012-09-11 15:40 ` Junio C Hamano 2 siblings, 1 reply; 10+ messages in thread From: Erik Faye-Lund @ 2012-09-11 10:06 UTC (permalink / raw) To: Roger Pau Monné; +Cc: git On Tue, Sep 11, 2012 at 11:21 AM, Roger Pau Monné <roger.pau@entel.upc.edu> wrote: > Hello, > > I'm using git for all my projects, and I usually work under Mac OS X > with the default filesystem (that's case-insensitive, but > case-preserving). I'm currently working on a project that has several > branches, and two of them are called origin/DHCPCD and origin/dhcpcd > respectively, that's unfortunate, but I cannot do anything about it. > This completely breaks the git repository, because > .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are > actually the same file, so when I try to update my repository > performing a git pull I get the following error: > > error: Ref refs/remotes/origin/dhcpcd is at > 6b371783de2def2d6e3ec2680ba731f7086067ee but expected > 79f701ce599a27043eed8343f76406014963278a > > So I was wondering if anyone has stumbled upon this issue, and what's > the best approach to fix it. > I have stumbled upon a similar issue on Windows (which also has a case-preserving filesystem), and I seem to remember the solution being something to do with packed refs. Perhaps we could change Git to detect name-collisions and automatically pack the refs in such cases? ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Git an case-insensitive Mac OS X filesystem 2012-09-11 10:06 ` Erik Faye-Lund @ 2012-09-11 10:28 ` Matthieu Moy 2012-09-11 11:18 ` Erik Faye-Lund 0 siblings, 1 reply; 10+ messages in thread From: Matthieu Moy @ 2012-09-11 10:28 UTC (permalink / raw) To: kusmabite; +Cc: Roger Pau Monné, git Erik Faye-Lund <kusmabite@gmail.com> writes: > I have stumbled upon a similar issue on Windows (which also has a > case-preserving filesystem), and I seem to remember the solution being > something to do with packed refs. Packed-refs use a format like this: $ tail -3 .git/packed-refs e94214ce4b8acefce06d4ea37b76ac0de11ecb2d refs/tags/v1.7.9.5 bf68fe0313c833fa62755176f6e24988ef7cf80f refs/tags/v1.7.9.6 3996bb24c84013ec9ce9fa0980ce61f9ef97be4d refs/tags/v1.7.9.7 so the ref name is stored within the file, not as the file name. So, yes, packing refs (done by "git pack-refs", called by "git gc" among other things) should solve case-insensitive issues. However, creating or updating refs after a pack will still create unpacked refs, so this solves the issue only if one of the colliding branches is not updated anymore. > Perhaps we could change Git to detect name-collisions and > automatically pack the refs in such cases? That's a bit harder than it seems, as the idea is to avoid re-writting the packed-refs file for each ref update. Repacking after each colliding ref update could be costly in terms of performance. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Git an case-insensitive Mac OS X filesystem 2012-09-11 10:28 ` Matthieu Moy @ 2012-09-11 11:18 ` Erik Faye-Lund 2012-09-11 11:25 ` Matthieu Moy 0 siblings, 1 reply; 10+ messages in thread From: Erik Faye-Lund @ 2012-09-11 11:18 UTC (permalink / raw) To: Matthieu Moy; +Cc: Roger Pau Monné, git On Tue, Sep 11, 2012 at 12:28 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote: > Erik Faye-Lund <kusmabite@gmail.com> writes: > >> I have stumbled upon a similar issue on Windows (which also has a >> case-preserving filesystem), and I seem to remember the solution being >> something to do with packed refs. > > Packed-refs use a format like this: > > $ tail -3 .git/packed-refs > e94214ce4b8acefce06d4ea37b76ac0de11ecb2d refs/tags/v1.7.9.5 > bf68fe0313c833fa62755176f6e24988ef7cf80f refs/tags/v1.7.9.6 > 3996bb24c84013ec9ce9fa0980ce61f9ef97be4d refs/tags/v1.7.9.7 > > so the ref name is stored within the file, not as the file name. So, > yes, packing refs (done by "git pack-refs", called by "git gc" among > other things) should solve case-insensitive issues. > > However, creating or updating refs after a pack will still create > unpacked refs, so this solves the issue only if one of the colliding > branches is not updated anymore. > Of course. In my case, the colliding refs weren't fetched from the same source IIRC. >> Perhaps we could change Git to detect name-collisions and >> automatically pack the refs in such cases? > > That's a bit harder than it seems, as the idea is to avoid re-writting > the packed-refs file for each ref update. Repacking after each colliding > ref update could be costly in terms of performance. Yes, but being costly in terms of performance is IMO a lot better than corrupting refs, which is what we currently do. And it should really only be costly in the case where there's actually such a cost, on a file system where such a collision can happen. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Git an case-insensitive Mac OS X filesystem 2012-09-11 11:18 ` Erik Faye-Lund @ 2012-09-11 11:25 ` Matthieu Moy 0 siblings, 0 replies; 10+ messages in thread From: Matthieu Moy @ 2012-09-11 11:25 UTC (permalink / raw) To: kusmabite; +Cc: Roger Pau Monné, git Erik Faye-Lund <kusmabite@gmail.com> writes: > Yes, but being costly in terms of performance is IMO a lot better than > corrupting refs, which is what we currently do. I'm not saying nothing should be done, but I'm not sure packed-refs are the right solution in the long term. We already have the foo Vs foo/bar issue (discussed in the "keeping reflog for deleted refs" discussion). I think the right way would be to re-think the way we map ref name to the filesystem, with proper escaping of capitals, slashes, ... But that's a rather big change to do (and I'm unlikely to be the one volunteering for it :-( ) -- Matthieu Moy http://www-verimag.imag.fr/~moy/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Git an case-insensitive Mac OS X filesystem 2012-09-11 9:21 Git an case-insensitive Mac OS X filesystem Roger Pau Monné [not found] ` <1347355466-ner-6656@calvin> 2012-09-11 10:06 ` Erik Faye-Lund @ 2012-09-11 15:40 ` Junio C Hamano 2 siblings, 0 replies; 10+ messages in thread From: Junio C Hamano @ 2012-09-11 15:40 UTC (permalink / raw) To: Roger Pau Monné; +Cc: git Roger Pau Monné <roger.pau@entel.upc.edu> writes: > Hello, > > I'm using git for all my projects, and I usually work under Mac OS X > with the default filesystem (that's case-insensitive, but > case-preserving). I'm currently working on a project that has several > branches, and two of them are called origin/DHCPCD and origin/dhcpcd > respectively, that's unfortunate, but I cannot do anything about it. > This completely breaks the git repository, because > .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are > actually the same file, so when I try to update my repository > performing a git pull I get the following error: > > error: Ref refs/remotes/origin/dhcpcd is at > 6b371783de2def2d6e3ec2680ba731f7086067ee but expected > 79f701ce599a27043eed8343f76406014963278a > > So I was wondering if anyone has stumbled upon this issue, and what's > the best approach to fix it. If "several" is manageably small, you can configure your refspecs to rename them, e.g. [remote "origin"] url = ... fetch = +refs/heads/master:refs/remotes/origin/master fetch = +refs/heads/dhcpcd:refs/remotes/origin/dhcpcd fetch = +refs/heads/DHCPCD:refs/remotes/origin/dhcpcd-u which tells $ git fetch origin to use your remote tracking branch origin/dhcpcd-u to copy from their DHCPCD. Then you can work on it the usual way. $ git checkout -b dhcpcd-u origin/dhcpcd-u $ work work work For pushing, you can rename it back in a similar way. $ git push origin dhcpcd-u:DHCPCD which is a short-hand for $ git push origin refs/heads/dhcpcd-u:refs/heads/DHCPCD ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-09-11 15:44 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-09-11 9:21 Git an case-insensitive Mac OS X filesystem Roger Pau Monné [not found] ` <1347355466-ner-6656@calvin> 2012-09-11 9:30 ` Roger Pau Monné 2012-09-11 9:36 ` Tomas Carnecky 2012-09-11 9:44 ` Roger Pau Monné 2012-09-11 15:44 ` Junio C Hamano 2012-09-11 10:06 ` Erik Faye-Lund 2012-09-11 10:28 ` Matthieu Moy 2012-09-11 11:18 ` Erik Faye-Lund 2012-09-11 11:25 ` Matthieu Moy 2012-09-11 15:40 ` Junio C Hamano
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).