Thread (33 messages) 33 messages, 5 authors, 2019-12-13

Re: [PATCH 00/13] git-p4: python3 compatibility

From: Johannes Schindelin <hidden>
Date: 2019-12-09 19:49:05

Hi Ben,

On Mon, 9 Dec 2019, Ben Keene wrote:
So, I just attempted to run a base case on windows: git p4 clone //depot and
I'm getting an error:

Depot paths must start with "//": /depot
You started this in a Bash, right?

The Git Bash has the very specific problem that many of Git's shell
scripts assume that forward slashes are directory separators, not
backslashes, and that absolute paths start with a single forward slash. In
other words, they expect Unix paths.

But we're on Windows! So the MSYS2 runtime (which is the POSIX emulation
layer derived from Cygwin which allows us to build and run Bash on
Windows) "translates" between the paths. For example, if you pass `/depot`
as a parameter to a Git command, the MSYS2 runtime notices that `git.exe`
is not an MSYS2 program (i.e. it does not understand pseudo-Unix paths),
and translates the path to `C:/Program Files/Git/depot`.

However, your call has _two_ slashes, right? That is unfortunately MSYS2's
trick to say "oh BTW keep the slash, this is not a Unix path".

To avoid this, just set `MSYS_NO_PATHCONV`, like so:

	MSYS_NO_PATHCONV=1 git p4 clone //depot

This behavior is documented in our release notes, by the way:
https://github.com/git-for-windows/build-extra/blob/master/ReleaseNotes.md#known-issues

Ciao,
Johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help