git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Steven Penny <svnpenn@gmail.com>
Cc: tboegi@web.de, git@vger.kernel.org
Subject: Re: [PATCH v1/RFC 1/1] 'git clone <url> C:\cygwin\home\USER\repo' is working (again)
Date: Tue, 27 Nov 2018 14:23:09 +0900	[thread overview]
Message-ID: <xmqqlg5ft7pe.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAAXzdLX4jU7+i1W1A_Q1LpPFa1D4FYVPW5rcMnqr_tDHEJn+tw@mail.gmail.com> (Steven Penny's message of "Mon, 26 Nov 2018 20:49:38 -0600")

Steven Penny <svnpenn@gmail.com> writes:

> If you strip the drive, you can still navigate within the same drive:
>
>     $ cd 'C:\Users'
>     $ pwd
>     /cygdrive/c/Users
>
>     $ cd '\Windows'
>     $ pwd
>     /cygdrive/c/Windows
>
> but you can no longer traverse drives:
>
>     $ cd '\Testing'
>     sh: cd: \Testing: No such file or directory

Sorry, but I fail to see the point the last example wants to make.
If it were

    $ cd /cygdrive/d/Testing
    $ cd /cygdrive/c/Users
    $ cd ../../d/Testing

and the last step fails, then I would suspect it would make sense to
treat /cygdrive/$X exactly like how we would treat $C:, because

    $ cd C:Users
    $ cd ../D:Testing

would not make sense, either, which is an indication that these two
are quite similar.  On the other hand, if "cd ../../d/Testing" above
does not fail and does what non-DOS users would expect, then that
strongly argues that treating /cygdrive/$X any specially is a mistake.

> So a good first question for me would be: why are we stripping "C:" or similar
> in the first place?

Sorry, but I do not see the connection to this question and the
above example.  The reason why we strip C: is because the letter
that comes after that colon determines if we are talking about
absolute path (in other words, the current directory does not play a
role in determining which directory the path refers to), unlike the
POSIX codepath where it is always the first letter in the pathname.

C:\Users is a directory whose name is Users at the top level of the
C: drive. C0\Users tells us that in the current directory, there is
a directory whose name is C0 and in it, there is a filesystem entity
whose name is Users.  So the colon that follows an alpha (in this
case, C:) is quite special, compared to other letters (in this
example, I used '0' to contrast its effect with ':').  So it is very
understandable why we want to have has_dos_prefix() and
skip_dos_prefix().

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

I'd defer to Windows folks to decide if a unified win.h is a good
idea.

Thanks.

  reply	other threads:[~2018-11-27  5:23 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-18 15:21 Cygwin Git with Windows paths Steven Penny
2018-11-18 15:41 ` Torsten Bögershausen
2018-11-18 16:23   ` Steven Penny
2018-11-18 17:15     ` Torsten Bögershausen
2018-11-18 17:34       ` Steven Penny
2018-11-18 18:28         ` Torsten Bögershausen
2018-11-18 19:00           ` Steven Penny
2018-11-19  0:06       ` Junio C Hamano
2018-11-19  2:11         ` Randall S. Becker
2018-11-19  3:33           ` Junio C Hamano
2018-11-19  5:20             ` Torsten Bögershausen
2018-11-20  0:17               ` Steven Penny
2018-11-20 10:36                 ` Torsten Bögershausen
2018-11-20 12:51                   ` Steven Penny
2018-11-19 12:22             ` Randall S. Becker
2018-11-26 17:32 ` [PATCH v1/RFC 1/1] 'git clone <url> C:\cygwin\home\USER\repo' is working (again) tboegi
2018-11-27  0:35   ` Steven Penny
2018-11-27  1:16   ` Junio C Hamano
2018-11-27  2:49     ` Steven Penny
2018-11-27  5:23       ` Junio C Hamano [this message]
2018-11-27  6:20         ` Steven Penny
2018-11-27 12:55         ` Johannes Schindelin
2018-11-28  4:10           ` Junio C Hamano
2018-11-28  5:55             ` J.H. van de Water
2018-11-28  8:46               ` Johannes Schindelin
2018-11-28  9:01                 ` Houder
2018-11-28  9:35                   ` Johannes Schindelin
2018-11-27 20:10     ` Achim Gratz
2018-11-27 12:49   ` Johannes Schindelin
2018-11-28  4:12     ` Junio C Hamano
2018-11-27 20:05   ` Achim Gratz
2018-12-07 17:04 ` [PATCH v2 1/3] git " tboegi
2018-12-07 21:53   ` Johannes Schindelin
2018-12-08  0:49   ` Steven Penny
2018-12-10  8:46     ` Johannes Schindelin
2018-12-10 12:45       ` Steven Penny
2018-12-11 13:39         ` Johannes Schindelin
2018-12-12  0:42           ` Steven Penny
2018-12-12  7:29             ` Johannes Sixt
2018-12-12 12:40               ` Steven Penny
2018-12-13  3:52                 ` Junio C Hamano
2018-12-12 13:33               ` Johannes Schindelin
2018-12-12  3:47     ` Elijah Newren
2018-12-12 13:57       ` Johannes Schindelin
2018-12-07 17:04 ` [PATCH v2 2/3] offset_1st_component(), dos_drive_prefix() return size_t tboegi
2018-12-07 17:05 ` [PATCH v2 3/3] Refactor mingw_cygwin_offset_1st_component() tboegi
2018-12-07 22:18   ` Johannes Schindelin
2018-12-08 15:11 ` [PATCH v3 1/1] git clone <url> C:\cygwin\home\USER\repo' is working (again) tboegi
2018-12-08 16:24   ` Steven Penny
2018-12-09  1:39   ` Junio C Hamano
2018-12-10  8:32   ` Johannes Schindelin
2018-12-11  6:12     ` Torsten Bögershausen
2018-12-11 13:28       ` Johannes Schindelin
2018-12-11 18:55         ` Torsten Bögershausen
2018-12-15  4:33 ` [PATCH v4 " tboegi
2019-05-02  7:48   ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqlg5ft7pe.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=svnpenn@gmail.com \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).