Thread (4 messages) 4 messages, 3 authors, 2021-12-07

Re: BUG: git bash / python interaction with absolute paths as environment variables in Windows

From: Johannes Schindelin <hidden>
Date: 2021-12-07 21:39:18

Hi Leland,

On Mon, 6 Dec 2021, Leland Weathers wrote:
Issue: Using Git Bash for Windows (2.34.1-64) and Python 3.9.9, a git
path is incorrectly prepended to environment variables in Python code.
From Git for Windows' [Release Notes' "Known Issues"
section](https://github.com/git-for-windows/build-extra/blob/master/ReleaseNotes.md#known-issues):

	* If you specify command-line options starting with a slash,
	  POSIX-to-Windows path conversion will kick in converting e.g.
	  "`/usr/bin/bash.exe`" to "`C:\Program Files\Git\usr\bin\bash.exe`".
	 When that is not desired -- e.g.
	 "`--upload-pack=/opt/git/bin/git-upload-pack`" or "`-L/regex/`" --
	 you need to set the environment variable `MSYS_NO_PATHCONV`
	 temporarily, like so:

	 > `MSYS_NO_PATHCONV=1 git blame -L/pathconv/ msys2_path_conv.cc`

	 Alternatively, you can double the first slash to avoid
	 POSIX-to-Windows path conversion, e.g. "`//usr/bin/bash.exe`".

Those release notes are shown by default when you install Git for Windows,
and they are also accessible via the Start Menu as "Git Release Notes".
[... snip ...]

In both cases I am using the same Python virtual environment. Other
environment variables (e.g. non-absolute directory paths) appear to be
read correctly. I'm assuming that this is a git issue given the
Premature end-of-mail?

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