git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Nov 11, 2016, 18:16 UTC
Message-ID
<20161111181658.bwclcxedsrs4wcu6@sigill.intra.peff.net>
In-Reply-To
<2b69d098-92ef-77b0-367a-516e9edbe257@kdbg.org>
On Fri, Nov 11, 2016 at 06:31:48PM +0100, Johannes Sixt wrote:
Show 11 quoted lines
> 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
Previous: Johannes SixtNext: Junio C Hamano
Message 5 of 17 in “mingw: hot-fix t5615”
  1. mingw: hot-fix t5615Johannes Schindelin, Nov 11, 2016
  2. Junio C HamanoNov 11, 2016
  3. Johannes SixtNov 11, 2016
  4. t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variablesJohannes Sixt, Nov 11, 2016
  5. Jeff KingNov 11, 2016
  6. Junio C HamanoNov 11, 2016
  7. Johannes SchindelinNov 12, 2016
  8. Junio C HamanoNov 13, 2016
  9. Lars SchneiderNov 14, 2016
  10. Torsten BögershausenNov 14, 2016
  11. Jeff KingNov 14, 2016
  12. Ramsay JonesNov 14, 2016
  13. Junio C HamanoNov 14, 2016
  14. Johannes SchindelinNov 15, 2016
  15. Johannes SchindelinNov 16, 2016
  16. Junio C HamanoNov 16, 2016
  17. Jeff KingNov 11, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.