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

BUG: "git var GIT_SHELL_PATH" is broken on Windows

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Jul 8, 2024, 10:07 UTC
Message-ID
<cc267962-ca2d-4c4a-9ed8-d40c4d282522@gmail.com>

Running "git var GIT_SHELL_PATH" on Windows prints "/bin/sh" which is not very helpful when the path to the shell is actually "C:\Users\gitlab_runner\scoop\apps\mingit-busybox\2.45.2\mingw64\bin\ash.exe"

Support for GIT_SHELL_PATH was added to "git var" in 1e65721227 (var: add support for listing the shell, 2023-06-27) with the aim of making it possible for external programs to learn the location of the shell used to run the command returned by "git var GIT_EDITOR". As the commit message notes this is especially helpful on Windows where the shell isn't necessarily in $PATH. Unfortunately the implementation simply prints SHELL_PATH which is unused on Windows. As 776297548e (Do not use SHELL_PATH from build system in prepare_shell_cmd on Windows, 2012-04-17) explains the location of the shell depends on git's installation prefix. For the git-for-windows builds it looks like the shell is always in "$GIT_EXEC_PATH/../../bin/" but I'm not sure if that is universally true.

It is possible to work around the bug by doing
     git -c 'alias.run-editor=!$(git var GIT_EDITOR)' run-editor

but it would be good to fix "git var GIT_SHELL_PATH" or at least document that it is broken on Windows

Best Wishes
Phillip
Next: brian m. carlson
Message 1 of 3 in “BUG: "git var GIT_SHELL_PATH" is broken on Windows”
  1. Phillip WoodJul 8, 2024
  2. brian m. carlsonJul 8, 2024
  3. Johannes SchindelinJul 8, 2024

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.