Thread (4 messages) 4 messages, 3 authors, 2016-11-11

Re: [PATCH] t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables

From: Jeff King <hidden>
Date: 2016-11-11 18:18:33

Possibly related (same subject, not in this thread)

On Fri, Nov 11, 2016 at 06:31:48PM +0100, Johannes Sixt wrote:
We have to use $PWD instead of $(pwd) because on Windows the latter
would add a C: style path to bash's Unix-style $PATH variable, which
becomes confused by the colon after the drive letter. ($PWD is a
Unix-style path.)

In the case of GIT_ALTERNATE_OBJECT_DIRECTORIES, bash on Windows
assembles a Unix-style path list with the colon as separators. It
converts the value to a Windows-style path list with the semicolon as
path separator when it forwards the variable to git.exe. The same
confusion happens when bash's original value is contaminated with
Windows style paths.
So on reading your original I wondered why you did not need to use the
";", and that explains it. But wow, it's subtle.

I don't know what people typically write in the wild, and if it's worth
actually testing explicitly the ";" case. I'll leave that to Windows
people to debate.

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