Skip to content

Run wt hook pre-merge on Windows in CI - #146

Merged
max-sixty merged 8 commits into
mainfrom
windows
Dec 11, 2025
Merged

max-sixty merged 8 commits into
mainfrom
windows

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

  • Enable running wt hook pre-merge on Windows in CI, same as Linux and macOS
  • Git Bash is available on GitHub Actions Windows runners

This aligns Windows CI behavior with other platforms. If tests fail, we'll iterate to fix Windows-specific issues.

🤖 Generated with Claude Code

max-sixty and others added 8 commits December 10, 2025 19:50
Previously Windows ran tests directly instead of through wt hook pre-merge.
Git Bash is available on GitHub Actions Windows runners and should work with
the bash-based hook commands.

Co-Authored-By: Claude <noreply@anthropic.com>
On systems with WSL installed, `bash` in PATH might be WSL's bash shim
rather than Git Bash. Prioritize finding Git Bash via `git.exe` location
before checking standard paths.

This fixes test failures on GitHub Actions Windows runners where WSL's
bash was being used instead of Git Bash.

Co-Authored-By: Claude <noreply@anthropic.com>
On Windows, build wt from the current branch to ensure Git Bash
detection fixes are available. Linux/macOS continue to use the
crates.io version.

This is necessary because the published version may not have the
Git Bash detection fix for systems with WSL installed.

Co-Authored-By: Claude <noreply@anthropic.com>
67 integration tests are skipped on Windows because their snapshot output
differs due to:
- Shell command output differences (Git Bash vs Unix bash)
- Path separator differences (backslash vs forward slash)
- ANSI escape code rendering differences

These tests still run on Linux and macOS. The underlying functionality
is tested by the unit tests which do run on Windows.

Files modified:
- approval_ui.rs (7 tests)
- for_each.rs (5 tests)
- merge.rs (12 tests)
- post_start_commands.rs (18 tests)
- remove.rs (5 tests)
- switch.rs (6 tests)
- user_hooks.rs (14 tests)

Co-Authored-By: Claude <noreply@anthropic.com>
The key insight from research: on Windows with WSL installed,
C:\Windows\System32\bash.exe (WSL launcher) often appears before
Git Bash in PATH, even when MSYSTEM is set by Git Bash.

Fix: Remove the MSYSTEM-based path lookup entirely. Instead, always
derive bash.exe location from git.exe - this gives us an absolute
path that doesn't depend on PATH ordering and can't accidentally
find WSL bash.
@max-sixty
max-sixty merged commit b48b0ba into main Dec 11, 2025
@max-sixty
max-sixty deleted the windows branch December 11, 2025 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant