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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/9/2019 2:48 PM, Johannes Schindelin wrote:
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?
No, I started it from a windows command cmd.exe prompt.  (I almost never use the bash prompt)

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`.
That is good to know!

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:

When I first installed git, I didn't read the release notes. (Shame on me!) and I installed python for windows and added an alias for git-p4.py against the windows version of
python, so when I run git, it's not performing that conversion.

	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


I'm starting to run out of time at work, so I'll be slow to try and repro this.

Thanks for the info!

- Ben




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux