Web lists-archives.com

Cygwin Git with Windows paths

Cygwin programs can handle Unix form paths:

   $ ls /var
   cache  lib  log  run  tmp

and also Windows form paths:

   $ ls 'C:\cygwin64\var'
   cache  lib  log  run  tmp

However current Cygwin Git cannot:

   $ 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

It seems the problem is that Git thinks the Windows form path is relative
because it does not start with "/". A Git Bisect reveals this:

05b458c104708141d2fad211d79703b3b99cc5a8 is the first bad commit
commit 05b458c104708141d2fad211d79703b3b99cc5a8
Author: Brandon Williams <bmwill@xxxxxxxxxx>
Date:   Mon Dec 12 10:16:52 2016 -0800

   real_path: resolve symlinks by hand

   The current implementation of real_path uses chdir() in order to resolve
   symlinks.  Unfortunately this isn't thread-safe as chdir() affects a
   process as a whole and not just an individual thread.  Instead perform
   the symlink resolution by hand so that the calls to chdir() can be
   removed, making real_path one step closer to being reentrant.

   Signed-off-by: Brandon Williams <bmwill@xxxxxxxxxx>
   Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>

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