Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Junio C Hamano
Roger Pau Monné  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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Junio C Hamano
Roger Pau Monné  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


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Matthieu Moy
Erik Faye-Lund  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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Erik Faye-Lund
On Tue, Sep 11, 2012 at 12:28 PM, Matthieu Moy
 wrote:
> Erik Faye-Lund  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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Matthieu Moy
Erik Faye-Lund  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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Erik Faye-Lund
On Tue, Sep 11, 2012 at 11:21 AM, Roger Pau Monné
 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?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Roger Pau Monné
On Tue, Sep 11, 2012 at 10:36 AM, Tomas Carnecky
 wrote:
> On Tue, Sep 11, 2012 at 9:30 AM, Roger Pau Monné
>  wrote:
>> On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky
>>  wrote:
>>> On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné 
>>>  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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Tomas Carnecky
On Tue, Sep 11, 2012 at 9:30 AM, Roger Pau Monné
 wrote:
> On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky
>  wrote:
>> On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné 
>>  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).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git an case-insensitive Mac OS X filesystem

2012-09-11 Thread Roger Pau Monné
On Tue, Sep 11, 2012 at 10:24 AM, Tomas Carnecky
 wrote:
> On Tue, 11 Sep 2012 10:21:16 +0100, Roger Pau Monné  
> 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?)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html