fix: run Git for Windows sh shim in POSIX mode - #2820
Conversation
|
I'm trying to remember why we didn't just go with passing |
|
Thanks for sharing! While somehow I lost the context of the agent that performed this work, I just asked again to see if the comments in the issue materially affect this implementation: short answer is No. Codex
No material correctness issue found. The issue comments support the branch’s approach:
One non-material residual edge remains: fallback Relevant crate tests, formatting, and |
f2565d1 to
6f27275
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f27275e3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Assisted-by: GPT 5.6 Co-authored-by: GPT 5.6 <codex@openai.com>
6f27275 to
da0903a
Compare
<!-- agent --> Construct default shell invocations with gix_path::env::shell_command() instead of rebuilding a Command from shell(). This preserves platform-specific arguments, notably --posix for the Git for Windows bin/sh.exe shim, while leaving caller-provided shells unchanged. Assisted-by: GPT 5.6 Co-authored-by: GPT 5.6 <codex@openai.com>
da0903a to
85f10fc
Compare
Tasks
Everything below this line is Codex
What changed
gix_path::env::shell()selected Git for Windows'bin/sh.exeshimgix_path::env::shell_command()to configure that shim with--posixgix-commandwhile leavingwith_shell_program()unchangedWhy
Git for Windows'
bin/sh.exeshim delegates tobash.exe. Unlike the non-shimusr/bin/sh.exe, that starts Bash without POSIX mode, so shell commands run bygix-commandbehave differently from shell commands run by Git.The POSIX option is applied only when the known Git for Windows shim was selected.
Fallback shells and caller-provided shell programs do not receive the Bash-specific
option.
Fixes #1868.
Validation
cargo test -p gix-commandcargo test -p gix-path -- --test-threads=1cargo clippy -p gix-path -p gix-command --lib -- -D warningscargo fmt --all -- --checkcargo doc -p gix-path --no-deps