{"thread":{"id":"23579","subject":"Case sensitivity on Windows for absolute paths.","startedAt":"2010-04-23T14:12:26Z","lastAt":"2010-04-25T18:47:23Z","messageCount":5,"participants":["Ricky Clarkson","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"140215","messageId":"o2v7eeb06461004230712i2c8c1e61l4c50a73a4f6c83d@mail.gmail.com","threadId":"23579","inReplyTo":null,"subject":"Case sensitivity on Windows for absolute paths.","fromName":"Ricky Clarkson","fromEmail":"ricky.clarkson@gmail.com","sentAt":"2010-04-23T14:12:26Z","receivedAt":"2010-04-23T14:12:26Z","isPatch":false,"sender":{"key":"ricky.clarkson@gmail.com","avatar":null},"body":"Hi,\n\nI noticed that if I have a git repository at C:\\foo, and there is a\nfile in there named bar, git add bar works fine, git add C:\\foo/bar\nworks fine but git add c:\\foo/bar does not.  git reports that the file\n'is outside repository'.  Looking at setup.c it seems that string\ncomparisons are being used to determine whether a file is within the\nrepository.\n\nFor my purposes I can probably make a Windows build that does it while\nignoring the case, but is there a more proper way that git should do\nit?  I'm not familiar enough with the POSIX file routines to know.\n\nA separate tool, maven, is what specifies it as lowercase, otherwise I\nwould obviously just write C: instead of c: myself.  I think I know\nhow to fix that so it uses relative paths, and will look into that,\nbut it would be good to have git do the right thing too.\n\nThanks,\nRicky.\n\n--\nRicky Clarkson\nJava and Scala Programmer, AD Holdings\n+44 1928 706373\nSkype: ricky_clarkson\nGoogle Talk: ricky.clarkson@gmail.com\nGoogle Wave: ricky.clarkson@googlewave.com\n"},{"id":"140235","messageId":"201004232146.56424.j6t@kdbg.org","threadId":"23579","inReplyTo":"o2v7eeb06461004230712i2c8c1e61l4c50a73a4f6c83d@mail.gmail.com","subject":"Re: Case sensitivity on Windows for absolute paths.","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2010-04-23T19:46:56Z","receivedAt":"2010-04-23T19:46:56Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Freitag, 23. April 2010, Ricky Clarkson wrote:\n> I noticed that if I have a git repository at C:\\foo, and there is a\n> file in there named bar, git add bar works fine, git add C:\\foo/bar\n> works fine but git add c:\\foo/bar does not.  git reports that the file\n> 'is outside repository'.  Looking at setup.c it seems that string\n> comparisons are being used to determine whether a file is within the\n> repository.\n\nYes, we should be a bit more liberal when drive letters are compared; they \nshould be treated in a case-insensitive manner, but currently we are strict.\n\n> For my purposes I can probably make a Windows build that does it while\n> ignoring the case, but is there a more proper way that git should do\n> it?  I'm not familiar enough with the POSIX file routines to know.\n\nMy guess is that it is sufficient that\n\n1. the internal version of GIT_DIR is recorded with an uppercase drive letter;\n\n2. normalize_path_copy() upper-cases the drive letter.\n\nThen the comparison in prefix_path() should do the right thing.\n\n-- Hannes\n"},{"id":"140317","messageId":"j2y7eeb06461004250033ue4434a41j7b9a752dea1f5fe1@mail.gmail.com","threadId":"23579","inReplyTo":"201004232146.56424.j6t@kdbg.org","subject":"Re: Case sensitivity on Windows for absolute paths.","fromName":"Ricky Clarkson","fromEmail":"ricky.clarkson@gmail.com","sentAt":"2010-04-25T07:33:22Z","receivedAt":"2010-04-25T07:33:22Z","isPatch":false,"sender":{"key":"ricky.clarkson@gmail.com","avatar":null},"body":"Hi again,\n\nIt would be good if git automatically uppercased the drive letter,\nyes.  However, I found the real root of my problem.  Git Bash\n(msysgit) sets the working directory to c:\\foo for programs launched\nif the working directory within it is /c/foo.  Like having spaces in\nfilenames, that just uncovers a whole myriad of small bugs and\noddities in other programs.\n\nFor reference, Cygwin doesn't have that problem; cd /cygdrive/c/foo &&\ncmd, cmd gets C:\\foo as its working directory.\n\nSo to make what I wanted work, I just made sure everything msysgit\ninstalled be on the PATH, then ran everything from cmd.\n\nI hope that this helps the next person who experiences this problem.\n\nThanks,\nRicky.\n\n--\nRicky Clarkson\nJava and Scala Programmer, AD Holdings\n+44 1928 706373\nSkype: ricky_clarkson\nGoogle Talk: ricky.clarkson@gmail.com\nGoogle Wave: ricky.clarkson@googlewave.com\n\n\n\nOn 23 April 2010 20:46, Johannes Sixt <j6t@kdbg.org> wrote:\n> On Freitag, 23. April 2010, Ricky Clarkson wrote:\n>> I noticed that if I have a git repository at C:\\foo, and there is a\n>> file in there named bar, git add bar works fine, git add C:\\foo/bar\n>> works fine but git add c:\\foo/bar does not.  git reports that the file\n>> 'is outside repository'.  Looking at setup.c it seems that string\n>> comparisons are being used to determine whether a file is within the\n>> repository.\n>\n> Yes, we should be a bit more liberal when drive letters are compared; they\n> should be treated in a case-insensitive manner, but currently we are strict.\n>\n>> For my purposes I can probably make a Windows build that does it while\n>> ignoring the case, but is there a more proper way that git should do\n>> it?  I'm not familiar enough with the POSIX file routines to know.\n>\n> My guess is that it is sufficient that\n>\n> 1. the internal version of GIT_DIR is recorded with an uppercase drive letter;\n>\n> 2. normalize_path_copy() upper-cases the drive letter.\n>\n> Then the comparison in prefix_path() should do the right thing.\n>\n> -- Hannes\n>\n"},{"id":"140352","messageId":"201004252008.27823.j6t@kdbg.org","threadId":"23579","inReplyTo":"j2y7eeb06461004250033ue4434a41j7b9a752dea1f5fe1@mail.gmail.com","subject":"Re: Case sensitivity on Windows for absolute paths.","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2010-04-25T18:08:27Z","receivedAt":"2010-04-25T18:08:27Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Sonntag, 25. April 2010, Ricky Clarkson wrote:\n> It would be good if git automatically uppercased the drive letter,\n> yes.  However, I found the real root of my problem.  Git Bash\n> (msysgit) sets the working directory to c:\\foo for programs launched\n> if the working directory within it is /c/foo.\n\nI don't understand what you mean. Git Bash cannot influence whether git sees \nthe drive letter in the working directory in uppercase or lowercase. Unless \nby \"working directory\" you mean something else than what getcwd() returns.\n\n-- Hannes\n"},{"id":"140356","messageId":"r2z7eeb06461004251147jce635231kca659b52a48571d0@mail.gmail.com","threadId":"23579","inReplyTo":"201004252008.27823.j6t@kdbg.org","subject":"Re: Case sensitivity on Windows for absolute paths.","fromName":"Ricky Clarkson","fromEmail":"ricky.clarkson@gmail.com","sentAt":"2010-04-25T18:47:23Z","receivedAt":"2010-04-25T18:47:23Z","isPatch":false,"sender":{"key":"ricky.clarkson@gmail.com","avatar":null},"body":"Hi Johannes,\n\n$ cd /c/uk-org-netvu/\n\nRicky@RICKY-XP /c/uk-org-netvu (trunk)\n$ cmd\nMicrosoft Windows XP [Version 5.1.2600]\n(C) Copyright 1985-2001 Microsoft Corp.\n\nc:\\uk-org-netvu>\n\nIf I run cmd via Start -> Run, then the prompt shows C:\\uk-org-netvu>\n\nI also verified this using the Scala interpreter, printing out\nSystem.getProperty(\"user.dir\"), which varied similarly in case\ndepending on whether I started it from cmd or from Git Bash.\n\nThanks,\nRicky.\n\n--\nRicky Clarkson\nJava and Scala Programmer, AD Holdings\n+44 1928 706373\nSkype: ricky_clarkson\nGoogle Talk: ricky.clarkson@gmail.com\nGoogle Wave: ricky.clarkson@googlewave.com\n\n\n\nOn 25 April 2010 19:08, Johannes Sixt <j6t@kdbg.org> wrote:\n> On Sonntag, 25. April 2010, Ricky Clarkson wrote:\n>> It would be good if git automatically uppercased the drive letter,\n>> yes.  However, I found the real root of my problem.  Git Bash\n>> (msysgit) sets the working directory to c:\\foo for programs launched\n>> if the working directory within it is /c/foo.\n>\n> I don't understand what you mean. Git Bash cannot influence whether git sees\n> the drive letter in the working directory in uppercase or lowercase. Unless\n> by \"working directory\" you mean something else than what getcwd() returns.\n>\n> -- Hannes\n>\n"}]}