C: vs /cygdrive/c and git

Eric Blake eblake@redhat.com
Thu Jun 3 20:39:00 GMT 2010


On 06/03/2010 02:32 PM, Bill Hoffman wrote:
> On 6/3/2010 4:20 PM, Eric Blake wrote:
>> On 06/03/2010 02:03 PM, Bill Hoffman wrote:
>>> Can someone explain why if I use c:/some/path as an argument to git
>>> clone, it fails.  But if I use /cygdrive/c/some/path it works.
>>
>> Because c:/some/path looks like you are asking for protocol:file for
>> talking to a remote machine, while /cygdrive/c/some/path makes it
>> obvious that you are asking for a local path, and because git is
>> compiled to behave in a posix manner.
>>
>> If drive letters work, great for you.  But if they don't, I am not going
>> to spend any time beating up the source code to make them work.  They
>> are intentionally unsupported here - we prefer posix paths for a reason.
>>
> OK, if that is really what is happening.  However, that does not seem to
> explain the translation of paths that I am seeing.
> 
> '/cygdrive/c/Users/hoffman/Work/My
> Builds/CMake-gmake/f/c:/Users/hoffman/Work/My
> Builds/CMake-gmake/Tests/ExternalProject/LocalRepositories/GIT/objects'
> 
> It is using the current directory smashed together with the c: path that
> I gave it.

In that case, git is just blindly treating c: as ./c: - that is, the
relative file named "c:" in the current directory.  Since POSIX allows
this interpretation, there's no reason for git to special case it and
try otherwise.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100603/ba93708e/attachment.sig>


More information about the Cygwin mailing list