Hooks: track pre-commit as executable so the policy check runs on Linux #253
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/253"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:50:53Z.
.githooks/pre-commitis tracked as100644. Git outside Windows skips a hook that is not executable and only prints a hint, so aftercargo xtask install-hooksa commit on Linux or macOS never runscargo xtask policy --staged:Git for Windows runs hooks regardless of the bit, so nothing changes there.
.githooks/pre-commitas100755(mode change only, contents unchanged).hooks_are_tracked_executableto xtask: it readsgit ls-files --stage -- .githooksand fails if a tracked hook is not100755(it skips itself outside a git checkout).Testing on Linux:
cargo test -p xtask: passes; with the bit flipped back viagit update-index --chmod=-xthe new test fails, naming the hook.cargo clippy -p xtask --all-targets -- -D warningsandcargo fmt --check: clean.core.hooksPath=.githooksnow runs the policy check on commit instead of printing the hint.Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T02:28:13Z.
Superseded by #246, which now includes this change (rebased onto main, with its test).
Pull request closed