Re: [PATCH v1/RFC 1/1] 'git clone <url> C:\cygwin\home\USER\repo' is working (again)
- From
Steven Penny <svnpenn@gmail.com>
- Date
- Nov 27, 2018, 02:49 UTC
- Message-ID
- <CAAXzdLX4jU7+i1W1A_Q1LpPFa1D4FYVPW5rcMnqr_tDHEJn+tw@mail.gmail.com>
- In-Reply-To
- <xmqqtvk3tj45.fsf@gitster-ct.c.googlers.com>
On Mon, Nov 26, 2018 at 7:16 PM Junio C Hamano wrote:
> I wonder if it makes the rest of the code simpler if we stripped > things like /cygdrive/c here exactly the sam way as we strip C: > For that, has_dos_drive_prefix() needs to know /cygdrive/[a-z], > which may not be a bad thing, I guess. Let's read on.
With full paths, Cygwin can traverse drives:
$ cd 'C:\Users'
$ pwd
/cygdrive/c/Users $ cd 'D:\Testing'
$ pwd
/cygdrive/d/TestingIf you strip the drive, you can still navigate within the same drive:
$ cd 'C:\Users'
$ pwd
/cygdrive/c/Users $ cd '\Windows'
$ pwd
/cygdrive/c/Windowsbut you can no longer traverse drives:
$ cd '\Testing'
sh: cd: \Testing: No such file or directorySo a good first question for me would be: why are we stripping "C:" or similar in the first place?
> - Is there a point in having cygwin specific variant of these, or > can we just borrow from mingw version (with some refactoring)? > Is there a point in doing so (e.g. if mingw plans to move to > reject forward slashes, attempting to share is pointless).
I would say these could be merged into a "win.h" or similar. Cygwin typically leans toward the "/unix/style" while MINGW has been more tolerant of "C:\Windows\Style" and "C:/Mixed/Style" paths, i dont see that changing.