threads / discuss / 6645

git and file name case on cygwin

Subject: git and file name case on cygwin

## tl;dr

9 messages between Feb 3, 2007 and Feb 4, 2007.

replies: 8people: 6as markdown or json

Niklas Höglund· Feb 3, 2007, 22:00 UTC · lore

There's something funny going on with git in cygwin. The following is in a clone of linux 2.6, with no local modifications (only the occasional pull from upstream).

Niklas Hoglund@NIKLAS /c/linux-2.6
$ git pull
remote: Generating pack...
remote: Done counting 220 objects.
remote: Result has 154 objects.
remote: Deltifying 154 objects.
remote:  100% (154/154) done
Unpacking 154 objects
remote: Total 154, written 154 (delta 124), reused 105 (delta 86)
 100% (154/154) done
* refs/heads/origin: fast forward to branch 'master' of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
  old..new: a7ec3f5..05a8057
Updating a7ec3f5..05a8057
include/linux/netfilter/xt_CONNMARK.h: needs update
include/linux/netfilter/xt_DSCP.h: needs update
include/linux/netfilter/xt_MARK.h: needs update
include/linux/netfilter_ipv4/ipt_CONNMARK.h: needs update
include/linux/netfilter_ipv4/ipt_DSCP.h: needs update
include/linux/netfilter_ipv4/ipt_ECN.h: needs update
include/linux/netfilter_ipv4/ipt_MARK.h: needs update
include/linux/netfilter_ipv4/ipt_TCPMSS.h: needs update
include/linux/netfilter_ipv4/ipt_TOS.h: needs update
include/linux/netfilter_ipv4/ipt_TTL.h: needs update
include/linux/netfilter_ipv6/ip6t_HL.h: needs update
include/linux/netfilter_ipv6/ip6t_MARK.h: needs update
net/ipv4/netfilter/ipt_ECN.c: needs update
net/ipv4/netfilter/ipt_TOS.c: needs update
net/ipv4/netfilter/ipt_TTL.c: needs update
net/ipv6/netfilter/ip6t_HL.c: needs update
net/netfilter/xt_CONNMARK.c: needs update
net/netfilter/xt_DSCP.c: needs update
net/netfilter/xt_mark.c: needs update
Fast forward
 MAINTAINERS                         |    6 +-
 arch/i386/kernel/acpi/boot.c        |    2 +-
 drivers/acpi/ec.c                   |    2 +-
 drivers/hid/Kconfig                 |   18 +++-
 drivers/net/Space.c                 |   11 --
 drivers/net/ifb.c                   |    4 +-
 drivers/net/loopback.c              |    4 +-
 drivers/net/sungem.c                |    3 +-
 drivers/net/sungem_phy.c            |  179 ++++++++++++++++++++++++++++++-----
 drivers/net/sungem_phy.h            |    7 +-
 drivers/usb/input/Kconfig           |    6 +-
 drivers/video/backlight/corgi_bl.c  |    2 +-
 drivers/video/backlight/hp680_bl.c  |    2 +-

Niklas Hoglund@NIKLAS /c/linux-2.6 $ git status # Changed but not updated: # (use git-update-index to mark for commit) # # modified: include/linux/netfilter/xt_CONNMARK.h # modified: include/linux/netfilter/xt_DSCP.h # modified: include/linux/netfilter/xt_MARK.h # modified: include/linux/netfilter_ipv4/ipt_CONNMARK.h # modified: include/linux/netfilter_ipv4/ipt_DSCP.h # modified: include/linux/netfilter_ipv4/ipt_ECN.h # modified: include/linux/netfilter_ipv4/ipt_MARK.h # modified: include/linux/netfilter_ipv4/ipt_TCPMSS.h # modified: include/linux/netfilter_ipv4/ipt_TOS.h # modified: include/linux/netfilter_ipv4/ipt_TTL.h # modified: include/linux/netfilter_ipv6/ip6t_HL.h # modified: include/linux/netfilter_ipv6/ip6t_MARK.h # modified: net/ipv4/netfilter/ipt_ECN.c # modified: net/ipv4/netfilter/ipt_TOS.c # modified: net/ipv4/netfilter/ipt_TTL.c # modified: net/ipv6/netfilter/ip6t_HL.c # modified: net/netfilter/xt_CONNMARK.c # modified: net/netfilter/xt_DSCP.c # modified: net/netfilter/xt_mark.c # nothing to commit

Niklas Hoglund@NIKLAS /c/linux-2.6 $ git reset --hard

Niklas Hoglund@NIKLAS /c/linux-2.6 $ git pull Already up-to-date.

Niklas Hoglund@NIKLAS /c/linux-2.6 $ git status # Changed but not updated: # (use git-update-index to mark for commit) # # modified: include/linux/netfilter/xt_connmark.h # modified: include/linux/netfilter/xt_dscp.h # modified: include/linux/netfilter/xt_mark.h # modified: include/linux/netfilter_ipv4/ipt_connmark.h # modified: include/linux/netfilter_ipv4/ipt_dscp.h # modified: include/linux/netfilter_ipv4/ipt_ecn.h # modified: include/linux/netfilter_ipv4/ipt_mark.h # modified: include/linux/netfilter_ipv4/ipt_tcpmss.h # modified: include/linux/netfilter_ipv4/ipt_tos.h # modified: include/linux/netfilter_ipv4/ipt_ttl.h # modified: include/linux/netfilter_ipv6/ip6t_hl.h # modified: include/linux/netfilter_ipv6/ip6t_mark.h # modified: net/ipv4/netfilter/ipt_ecn.c # modified: net/ipv4/netfilter/ipt_tos.c # modified: net/ipv4/netfilter/ipt_ttl.c # modified: net/ipv6/netfilter/ip6t_hl.c # modified: net/netfilter/xt_MARK.c # modified: net/netfilter/xt_connmark.c # modified: net/netfilter/xt_dscp.c # nothing to commit

Notice how all the files in the above list changed case since the previous invocation of git status.

The above has the unfortunate effect that the merge in a pull often refuses to run, requiring "git reset --hard origin" to update the working tree.

Linus Torvalds· Feb 4, 2007, 01:17 UTC · re: Niklas Höglund · lore

Re: git and file name case on cygwin

On Sat, 3 Feb 2007, Niklas Höglund wrote:
>
> There's something funny going on with git in cygwin. The following is
> in a clone of linux 2.6, with no local modifications (only the
> occasional pull from upstream).
You are using a filesystem that isn't able to handle the Linux kernel.

Make sure you don't try to maintain kernel source trees on a filesystem that isn't case-sensitive. Here's a clue:

	include/linux/netfilter/xt_dscp.h
	include/linux/netfilter/xt_DSCP.h
are both tracked files..
		Linus
Junio C Hamano· Feb 4, 2007, 01:25 UTC · re: Linus Torvalds · lore

Re: git and file name case on cygwin

Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 15 quoted lines
> On Sat, 3 Feb 2007, Niklas Höglund wrote:
>>
>> There's something funny going on with git in cygwin. The following is
>> in a clone of linux 2.6, with no local modifications (only the
>> occasional pull from upstream).
>
> You are using a filesystem that isn't able to handle the Linux kernel.
>
> Make sure you don't try to maintain kernel source trees on a filesystem 
> that isn't case-sensitive. Here's a clue:
>
> 	include/linux/netfilter/xt_dscp.h
> 	include/linux/netfilter/xt_DSCP.h
>
> are both tracked files..

Are there plans to "fix" the confusion by renaming them to reduce chances of name clashes on such suboptimal filesystems?

Linus Torvalds· Feb 4, 2007, 01:38 UTC · re: Junio C Hamano · lore

Re: git and file name case on cygwin

On Sat, 3 Feb 2007, Junio C Hamano wrote:
> 
> Are there plans to "fix" the confusion by renaming them to
> reduce chances of name clashes on such suboptimal filesystems?

I don't think so. Nobody really does development on such broken filesystems, and I kind of have this nagging suspicion that Niklas noticed just because he wanted to test git, not because he really wanted to do Linux development under Windows ;)

That said, it might not be horrible to do. Doing
	git ls-files | sort -f | uniq -ic | grep -v ' 1 '

shows that we only have 19 names so afflicted, and they're all in netfilter. Maybe the netfilter people could be convinced not to do it.

But really, do we actually expect anybody to really *care*?
		Linus
Junio C Hamano· Feb 4, 2007, 01:44 UTC · re: Linus Torvalds · lore

Re: git and file name case on cygwin

Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 18 quoted lines
> On Sat, 3 Feb 2007, Junio C Hamano wrote:
>> 
>> Are there plans to "fix" the confusion by renaming them to
>> reduce chances of name clashes on such suboptimal filesystems?
>
> I don't think so. Nobody really does development on such broken 
> filesystems, and I kind of have this nagging suspicion that Niklas noticed 
> just because he wanted to test git, not because he really wanted to do 
> Linux development under Windows ;)
>
> That said, it might not be horrible to do. Doing
>
> 	git ls-files | sort -f | uniq -ic | grep -v ' 1 '
>
> shows that we only have 19 names so afflicted, and they're all in 
> netfilter. Maybe the netfilter people could be convinced not to do it.
>
> But really, do we actually expect anybody to really *care*?

Not really, I was just fishing for an ammunition to use in a different thread, concerning another filesystem whose readdir() returns something different from what the user fed creat() to create the file.

Niklas Höglund· Feb 4, 2007, 13:59 UTC · re: Linus Torvalds · lore

Re: git and file name case on cygwin

On Sat, 2007-02-03 at 17:17 -0800, Linus Torvalds wrote: 
Show 6 quoted lines
> Here's a clue:
> 
> 	include/linux/netfilter/xt_dscp.h
> 	include/linux/netfilter/xt_DSCP.h
> 
> are both tracked files..

Oh. It never struck me that people would use the "same" name for two different things. I thought it was something more subtle, like I file being renamed from one case to another. I should have looked a bit more carefully.

On Sat, 2007-02-03 at 17:38 -0800, Linus Torvalds wrote:
Show 9 quoted lines
> On Sat, 3 Feb 2007, Junio C Hamano wrote:
> > 
> > Are there plans to "fix" the confusion by renaming them to
> > reduce chances of name clashes on such suboptimal filesystems?
> 
> I don't think so. Nobody really does development on such broken 
> filesystems, and I kind of have this nagging suspicion that Niklas noticed 
> just because he wanted to test git, not because he really wanted to do 
> Linux development under Windows ;)

It's true that I don't intend to do any Linux development on a Windows system. I'd use a Linux system or a Linux VM for that. I do on occasion have a look through the Linux source code when I'm struggling with some badly documented hardware, but I could use a tarball for that. (I guess the netfilter code would still get mangled, but I can live with that.)

Niklas
Mark Levedahl· Feb 4, 2007, 14:17 UTC · re: Niklas Höglund · lore

Re: git and file name case on cygwin

Niklas Höglund wrote:
Show 8 quoted lines
> It's true that I don't intend to do any Linux development on a Windows
> system. I'd use a Linux system or a Linux VM for that. I do on occasion
> have a look through the Linux source code when I'm struggling with some
> badly documented hardware, but I could use a tarball for that. (I guess
> the netfilter code would still get mangled, but I can live with that.)
>
> Niklas
>   

Note that cygwin provides mananged mounts (mount -omanaged) that handles files whose names differ only in case. The names are of course mangled when exploring via native windows tools but not cygwin tools. e.g.,

t>touch file1 File1 t>ls File1 file1 t>cmd /c dir /b %46ile1 file1

Mark
Jakub Narebski· Feb 4, 2007, 14:27 UTC · re: Niklas Höglund · lore

Re: git and file name case on cygwin

Niklas Höglund wrote:
> [...] I do on occasion
> have a look through the Linux source code when I'm struggling with some
> badly documented hardware, but I could use a tarball for that. (I guess
> the netfilter code would still get mangled, but I can live with that.)
If you have net access, you could use gitweb for that...
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Sam Ravnborg· Feb 4, 2007, 15:01 UTC · re: Linus Torvalds · lore

Re: git and file name case on cygwin

On Sat, Feb 03, 2007 at 05:38:16PM -0800, Linus Torvalds wrote:
Show 11 quoted lines
> 
> 
> On Sat, 3 Feb 2007, Junio C Hamano wrote:
> > 
> > Are there plans to "fix" the confusion by renaming them to
> > reduce chances of name clashes on such suboptimal filesystems?
> 
> I don't think so. Nobody really does development on such broken 
> filesystems, and I kind of have this nagging suspicion that Niklas noticed 
> just because he wanted to test git, not because he really wanted to do 
> Linux development under Windows ;)

At my present work we do all development under Windows and this is what we have used since day one. Shifting the underlying OS to Linux last year should not and did not trigger a development environment revolution (read: change to Linux).

But it would still be preferable to actually build the Linux kernel on Windows so there is no need to do a remote build for part of the system and the rest on the Windows host. Or in other words to make the kernel build able on Windows does not imply the desire to actually do kernel development on Windows.

	Sam

← back to recent threads