diff options
Diffstat (limited to 'docs/windows')
| -rw-r--r-- | docs/windows/polyglot-hooks.md | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/windows/polyglot-hooks.md b/docs/windows/polyglot-hooks.md index d1bcb84..3da01ae 100644 --- a/docs/windows/polyglot-hooks.md +++ b/docs/windows/polyglot-hooks.md @@ -77,12 +77,19 @@ afterward. 1. The batch section validates the script name and resolves the hook directory from the dispatcher's own location. -2. It tries bash in three places: +2. It tries bash in four places, in order: - `C:\Program Files\Git\bin\bash.exe` - `C:\Program Files (x86)\Git\bin\bash.exe` - - `bash` on `PATH` (MSYS2, Cygwin, or a non-default Git install) + - `%LOCALAPPDATA%\Programs\Git\bin\bash.exe` (a per-user Git for Windows + install), only when `LOCALAPPDATA` is set + - `bash` on `PATH` (MSYS2, Cygwin, or a non-default Git install), found by + running `%SystemRoot%\System32\where.exe $PATH:bash`, so neither `where` + nor `bash` is taken from the current directory. The WSL launchers + (`bash.exe` in `System32`, `Sysnative`, or + `%LOCALAPPDATA%\Microsoft\WindowsApps`) and extensionless matches are + skipped, since the launchers fail when no Linux distro is installed. 3. If bash is found, it runs the named extensionless hook script from the hooks - directory. + directory and exits with the script's exit code. 4. If no bash is found, the dispatcher exits `0` silently — the plugin continues working, it just skips the hook. 5. `exit /b` stops CMD before it reaches the Unix section. @@ -142,7 +149,7 @@ escape_for_json() { ### "bash is not recognized" -CMD couldn't find bash in any of the three locations the dispatcher tries. The dispatcher exits silently (0) rather than erroring, so the hook is skipped. Install Git for Windows at the standard path or ensure `bash` is on `PATH`. +CMD couldn't find bash in any of the four locations the dispatcher tries. The dispatcher exits silently (0) rather than erroring, so the hook is skipped. Install Git for Windows (system-wide or per-user) or ensure a non-WSL `bash` is on `PATH`. ### Hook runs on Unix but does nothing on Windows |
