This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C: vs /cygdrive/c and git


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. I would expect something different if git thought that I was talking about a remote machine called c:.

Something like this:

$ git clone fooba:/Users/hoffman/Work/My\ Builds/CMake-gmake/Tests/ExternalProject/LocalRepositories/GIT a
Initialized empty Git repository in /cygdrive/c/Users/hoffman/Work/My Builds/CMake-gmake/a/.git/
ssh: Could not resolve hostname fooba: hostname nor servname provided, or not known
fatal: The remote end hung up unexpectedly


Instead I get something like this:

$ git clone c:/Users/hoffman/Work/My\ Builds/CMake-gmake/Tests/ExternalProject/LocalRepositories/GIT a
Initialized empty Git repository in /cygdrive/c/Users/hoffman/Work/My Builds/CMake-gmake/a/.git/
fatal: failed to open '/cygdrive/c/Users/hoffman/Work/My Builds/CMake-gmake/c:/Users/hoffman/Work/My Builds/CMake-gmake/Tests/ExternalProject/LocalRepositories/GIT/objects': No such file or directory


Which is failed to open:
/cygdrive/c/current/dir/c:/path/given

I have seen something similar with another program as well. It seems that something changed in the cygwin dll recently that is affecting the Path handling with driver letters. I was hoping someone could explain what changed, so I could work around the change and know what to expect. I don't think this is an issue specific to git.

Thanks.

-Bill

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]