Discussion:
Cygwin Git with Windows paths
Steven Penny
2018-11-18 06:07:17 UTC
Permalink
Cygwin Git can clone with Unix form paths:

$ git clone git://github.com/benhoyt/goawk /tmp/goawk
Cloning into '/tmp/goawk'...
remote: Enumerating objects: 330, done.

However it fails with Windows form:

$ git clone git://github.com/benhoyt/goawk 'C:\cygwin64\tmp\goawk'
Cloning into 'C:\cygwin64\tmp\goawk'...
fatal: Invalid path '/home/Steven/C:\cygwin64\tmp\goawk': No such file or
directory

and mixed form:

$ git clone git://github.com/benhoyt/goawk C:/cygwin64/tmp/goawk
fatal: Invalid path '/home/Steven/C:/cygwin64': No such file or directory

Note that other Cygwin programs work fine with these forms:

$ ls 'C:\cygwin64'
bin Cygwin.ico dev home sbin usr
Cygwin.bat Cygwin-Terminal.ico etc lib tmp var

This causes problems for any non-Cygwin tools that might call Git:

http://github.com/golang/go/issues/23155


--
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
Ray Donnelly
2018-11-18 08:35:50 UTC
Permalink
This is very much the point of msys2.
Post by Steven Penny
$ git clone git://github.com/benhoyt/goawk /tmp/goawk
Cloning into '/tmp/goawk'...
remote: Enumerating objects: 330, done.
$ git clone git://github.com/benhoyt/goawk 'C:\cygwin64\tmp\goawk'
Cloning into 'C:\cygwin64\tmp\goawk'...
fatal: Invalid path '/home/Steven/C:\cygwin64\tmp\goawk': No such file or
directory
$ git clone git://github.com/benhoyt/goawk C:/cygwin64/tmp/goawk
fatal: Invalid path '/home/Steven/C:/cygwin64': No such file or directory
$ ls 'C:\cygwin64'
bin Cygwin.ico dev home sbin usr
Cygwin.bat Cygwin-Terminal.ico etc lib tmp var
http://github.com/golang/go/issues/23155
--
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
--
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
Brian Inglis
2018-11-18 16:49:17 UTC
Permalink
Post by Ray Donnelly
Post by Steven Penny
$ git clone git://github.com/benhoyt/goawk /tmp/goawk
Cloning into '/tmp/goawk'...
remote: Enumerating objects: 330, done.
$ git clone git://github.com/benhoyt/goawk 'C:\cygwin64\tmp\goawk'
Cloning into 'C:\cygwin64\tmp\goawk'...
fatal: Invalid path '/home/Steven/C:\cygwin64\tmp\goawk': No such file or
directory
Use cygpath:

$ git clone git://github.com/benhoyt/goawk `cygpath 'C:\cygwin64\tmp\goawk'`
Post by Ray Donnelly
Post by Steven Penny
$ git clone git://github.com/benhoyt/goawk C:/cygwin64/tmp/goawk
$ git clone git://github.com/benhoyt/goawk $(cygpath C:/cygwin64/tmp/goawk)
Post by Ray Donnelly
Post by Steven Penny
fatal: Invalid path '/home/Steven/C:/cygwin64': No such file or directory
$ ls 'C:\cygwin64'
bin Cygwin.ico dev home sbin usr
Cygwin.bat Cygwin-Terminal.ico etc lib tmp var
If Windows paths work, that's convenient; if Windows paths don't work, use
cygpath, as it is often required, that's why it's available.
Post by Ray Donnelly
Post by Steven Penny
http://github.com/golang/go/issues/23155
This is very much the point of msys2.
Also Git for Windows (MinGW based) which tries to provide a more compatible
experience without msys2 DLLs; and which can also be installed under msys2.
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
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
cyg Simple
2018-11-18 17:43:40 UTC
Permalink
   $ git clone git://github.com/benhoyt/goawk /tmp/goawk
   Cloning into '/tmp/goawk'...
   remote: Enumerating objects: 330, done.
   $ git clone git://github.com/benhoyt/goawk 'C:\cygwin64\tmp\goawk'
   Cloning into 'C:\cygwin64\tmp\goawk'...
   fatal: Invalid path '/home/Steven/C:\cygwin64\tmp\goawk': No such
file or
   directory
   $ git clone git://github.com/benhoyt/goawk C:/cygwin64/tmp/goawk
   fatal: Invalid path '/home/Steven/C:/cygwin64': No such file or
directory
   $ ls 'C:\cygwin64'
   bin         Cygwin.ico           dev  home  sbin  usr
   Cygwin.bat  Cygwin-Terminal.ico  etc  lib   tmp   var
http://github.com/golang/go/issues/23155
What exactly are you trying to solve by your query? The golang issue
you point to is marked as resolved and many suggestions similar to the
ones you've been given in this query exist in it; including a go script
to convert the strings on the command line. I probably would use a
similar method with a bash script but calling cygpath.

Good luck,
--
cyg Simple

--
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
Adam Dinwoodie
2018-11-26 22:54:14 UTC
Permalink
Post by Steven Penny
$ git clone git://github.com/benhoyt/goawk /tmp/goawk
Cloning into '/tmp/goawk'...
remote: Enumerating objects: 330, done.
$ git clone git://github.com/benhoyt/goawk 'C:\cygwin64\tmp\goawk'
Cloning into 'C:\cygwin64\tmp\goawk'...
fatal: Invalid path '/home/Steven/C:\cygwin64\tmp\goawk': No such file or
directory
$ git clone git://github.com/benhoyt/goawk C:/cygwin64/tmp/goawk
fatal: Invalid path '/home/Steven/C:/cygwin64': No such file or directory
$ ls 'C:\cygwin64'
bin Cygwin.ico dev home sbin usr
Cygwin.bat Cygwin-Terminal.ico etc lib tmp var
http://github.com/golang/go/issues/23155
Personally, I don't see this as a bug; AIUI using Windows style paths
isn't something that is supported in general in Cygwin, even if it's
something that works in some circumstances. I acknowledge that this
causes problems for non-Cygwin tools using Cygwin Git, but the
solution there is to either use Cygwin aware/native versions of those
tools, or to use non-Cygwin versions of Git.

In particular, I'm wary of fixing this set of interop problem
introducing some other problem; I'd prefer Cygwin tools to fail to
handle Windows paths entirely than the current situation where "c:"
refers to a file of that exact name in the current directory, and
"c:\" sometimes refers to a completely different directory, when on
*nix systems in general both would refer to files in the current
directory.

I see you've raised this on the Git mailing list as well, and if the
upstream Git package starts to handle such paths, I'll take the
relevant patches. However since I don't consider this a bug, I'm not
going to raise it myself.

Adam

--
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
Steven Penny
2018-11-27 01:09:31 UTC
Permalink
Post by Adam Dinwoodie
Personally, I don't see this as a bug; AIUI using Windows style paths
isn't something that is supported in general in Cygwin, even if it's
something that works in some circumstances.
It is a bug. Even when you use Unix paths, Cygwin is doing path conversions:

$ ls /var
cache lib log run tmp

$ strace ls /var | grep -E '(conv_to|normalize)_(posix|win32)_path' | wc
32 320 3337

So either this code should be pulled out of the Cygwin DLL, or people should
stop saying that its not supported.
Post by Adam Dinwoodie
I see you've raised this on the Git mailing list as well, and if the
upstream Git package starts to handle such paths, I'll take the
relevant patches. However since I don't consider this a bug, I'm not
going to raise it myself.
Its not fixed upstream (yet), but a patch is available that fixes the issue:

http://public-inbox.org/git/20181126173252.1558-1-***@web.de

Note carefully that Windows path handling previously worked with Cygwin Git
until Dec 2016, when a patch was introduced that broke that use case. The patch
in question repairs the path handling so that Unix and Windows paths are both
supported with Cygwin Git again.


--
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
Vince Rice
2018-11-27 01:27:51 UTC
Permalink
Post by Adam Dinwoodie
Personally, I don't see this as a bug; AIUI using Windows style paths
isn't something that is supported in general in Cygwin, even if it's
something that works in some circumstances.
It's not a bug. Cygwin has been on record for a very long time that Windows paths might work, but since it's emulating Linux, they are not guaranteed to work. If they work, great. If they don't work, too bad. Some maintainers try to keep them working in their respective programs, but that is a courtesy, not fixing a bug.


--
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
Marco Atzeri
2018-11-27 08:11:04 UTC
Permalink
Post by Adam Dinwoodie
Personally, I don't see this as a bug; AIUI using Windows style paths
isn't something that is supported in general in Cygwin, even if it's
something that works in some circumstances.
   $ ls /var
   cache  lib  log  run  tmp
   $ strace ls /var | grep -E '(conv_to|normalize)_(posix|win32)_path'
| wc
   32     320    3337
It is not a bug, and you are misunderstanding these calls.
Of course the internal of cygwin need to convert the posix
to win32 call, as the true kernel is Windows and the cygwin1.dll
is the library responsable for the interface.
So either this code should be pulled out of the Cygwin DLL, or people should
stop saying that its not supported.
Cool down please.
If you need a git that understand windows paths you should not use
the cygwin one.

Regards
Marco



---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus


--
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
cyg Simple
2018-11-27 15:57:46 UTC
Permalink
Post by Marco Atzeri
Cool down please.
If you need a git that understand windows paths you should not use
the cygwin one.
It is this stance that caused MSYS to exist. It is this stance that
caused the git developers to choose MSYS for the Windows support model.
However, it is correct to say, when in Cygwin use POSIX paths as Windows
paths are not warranted to work. The \ character may even cause a `\t'
to be <TAB> or a \m to be a <RETURN>, etc. as that is what is described
by POSIX. And 'C:/' in POSIX speak refers to a directory in the current
working directory named `C:'. But Cygwin tries to be nice and play with
the strings beginning with [A-Za-z] followed by : as a device
designation but if it works it works and if it doesn't work it doesn't
work; you must live with the results and work (around) them as needed.

To work around the issues I often use /etc/fstab to create a mount point
for a troublesome Windows style path. I can then use the POSIX format
to alleviate the issue.
--
cyg Simple

--
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
Andrey Repin
2018-11-27 14:35:18 UTC
Permalink
Greetings, Adam Dinwoodie!
Post by Adam Dinwoodie
Personally, I don't see this as a bug; AIUI using Windows style paths
isn't something that is supported in general in Cygwin, even if it's
something that works in some circumstances. I acknowledge that this
causes problems for non-Cygwin tools using Cygwin Git, but the
solution there is to either use Cygwin aware/native versions of those
tools, or to use non-Cygwin versions of Git.
The problem with Git is that it relies on entire POSIX ecosystem, contrary to,
say, Subversion, which is just one drop-in binary.
Post by Adam Dinwoodie
In particular, I'm wary of fixing this set of interop problem
introducing some other problem; I'd prefer Cygwin tools to fail to
handle Windows paths entirely than the current situation where "c:"
refers to a file of that exact name in the current directory, and
"c:\" sometimes refers to a completely different directory, when on
*nix systems in general both would refer to files in the current
directory.
Then it would just make Cygwin as useless as WSL.
Post by Adam Dinwoodie
I see you've raised this on the Git mailing list as well, and if the
upstream Git package starts to handle such paths, I'll take the
relevant patches. However since I don't consider this a bug, I'm not
going to raise it myself.
--
With best regards,
Andrey Repin
Tuesday, November 27, 2018 17:33:24

Sorry for my terrible english...


--
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
Loading...