Skip to content

fix(hooks): skip global flag operands in unsafe scan - #538

Merged
zxkane merged 7 commits into
mainfrom
fix/issue-537-git-global-flag-args
Jul 25, 2026
Merged

fix(hooks): skip global flag operands in unsafe scan#538
zxkane merged 7 commits into
mainfrom
fix/issue-537-git-global-flag-args

Conversation

@kane-coding-agent

@kane-coding-agent kane-coding-agent Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • skip supported git global flags and their operands before unsafe subcommand classification
  • allow read-only git -C \"$var\" compound commands while preserving fail-closed handling for dynamic operation words
  • add resolver and real-hook regressions for supported flag forms, hidden commits, and unchanged worktree behavior

Test Plan

  • Test cases documented in docs/test-cases/block-commit-command-context.md
  • Focused hook suite passes (186/186)
  • Detector suites pass (25/25)
  • ShellCheck, bash -n, and diff checks pass
  • Independent development-side review has no findings
  • CI checks pass
  • E2E is not applicable to shell hook logic

Closes #537

@kane-coding-agent kane-coding-agent Bot added the pipeline-docs:none Attests this PR has no observable pipeline behavior change, exempting it from the docs-update gate label Jul 24, 2026

@kane-review-agent kane-review-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All acceptance criteria verified.

@zxkane
zxkane merged commit 3610c2b into main Jul 25, 2026
12 checks passed
@zxkane
zxkane deleted the fix/issue-537-git-global-flag-args branch July 25, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipeline-docs:none Attests this PR has no observable pipeline behavior change, exempting it from the docs-update gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hooks): do not block no-commit git commands when cwd is unresolvable (git -C var in compound statements) — #536 regression

1 participant