Re: [PATCH] var(win32): do report the GIT_SHELL_PATH that is actually used
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 9, 2024, 13:53 UTC
- Message-ID
- <9e2e32d2-4f52-43db-b2bd-8cf2df1af10c@gmail.com>
- In-Reply-To
- <Zox48sVp-PybvLxi@tapette.crustytoothpaste.net>
On 09/07/2024 00:40, brian m. carlson wrote:
Show 11 quoted lines
> On 2024-07-08 at 18:54:41, Junio C Hamano wrote: >> The "look on the %PATH%" strategy does not make any sense as an >> implementation for getting GIT_SHELL_PATH, which answers "what is >> the shell this instanciation of Git was built to work with?", at >> least to me. Maybe I am missing some knowledge on limitations on >> Windows and Git for Windows why it is done that way. > > Well, it may be that that's the approach that Git for Windows takes to > look up the shell. (I don't know for certain.) If that _is_ what it > does, then that's absolutely the value we want because we want to use > whatever shell Git for Windows uses.
As I understand it this is the approach Git for Windows takes
> I will say it's a risky approach > because it could well also find a Cygwin or MINGW shell (or, if it were > called bash, WSL), but we really want whatever Git for Windows does > here.
Git for Windows prepends the MINGW system directories to $PATH via some extra downstream code in setup_windows_environment() so looking up the shell in $PATH will find the correct executable.
Best Wishes
Phillip