Skip to content

fix(hook): honor Git subcommand exclusions after global options - #3880

Open
pederbe wants to merge 1 commit into
rtk-ai:developfrom
pederbe:fix/3838-git-global-option-exclusions
Open

pederbe wants to merge 1 commit into
rtk-ai:developfrom
pederbe:fix/3838-git-global-option-exclusions

Conversation

@pederbe

@pederbe pederbe commented Sep 5, 2026 •

Copy link
Copy Markdown

Summary

  • Match Git exclusions against both the original command and the form already used for routing. An exclusion for git worktree now also covers git -C /path worktree prune --dry-run --verbose.
  • Preserve option-specific exclusions, regex anchoring, and unrelated subcommands. Add regression coverage for global options, wrappers, and compound commands.

Issue

Fixes #3838

Test plan

  • Four new regression tests: three failed before the fix; all four pass afterward.
  • All 412 command-registry tests pass.
  • cargo fmt --all --check
  • cargo clippy --locked --all-targets
  • CLI smoke check: an unexcluded git -C ... worktree command still rewrites normally. Configured exclusions are exercised through the Rust rewrite entry point.
  • Full suite: cargo test --locked --all --no-fail-fast reports 3,136 passed, eight ignored, and one failed. The failure is core::stream::tests::test_run_streaming_raw_cap_at_10mb, whose dd/fold prerequisites are absent. It also fails on the clean base, e53ec1c.

For validation I used Rust 1.98.1 on GNU Windows. I used a local compiler wrapper that translated the existing MSVC-only /STACK:8388608 linker argument to GNU syntax; build.rs is unchanged. Some integration suites are disabled on Windows. Linux/macOS and an unmodified MSVC build have not been tested.

Other

I used Codex to help implementation, tests, and an adversarial review.

@CLAassistant

CLAassistant commented Sep 5, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@pederbe
pederbe marked this pull request as ready for review September 5, 2026 13:44
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.

exclude_commands is matched on the raw command, so git -C <path> escapes it

2 participants