Skip to content

fix(hooks): export skip-worktree entries into the pre-commit snapshot - #20

Open
paustint wants to merge 1 commit into
mainfrom
fix/pre-commit-skip-worktree
Open

paustint wants to merge 1 commit into
mainfrom
fix/pre-commit-skip-worktree

Conversation

@paustint

Copy link
Copy Markdown
Contributor

Summary

The pre-commit hook exports the index with git checkout-index --all. By default, that command skips entries with the skip-worktree bit set, which a sparse checkout or git update-index --skip-worktree sets. Those files never reached the snapshot, so they escaped both oxfmt and oxlint. --ignore-skip-worktree-bits exports every index entry.

The hook is shared verbatim, and the other three copies get the same one-flag change, so all four stay byte-identical:

No CHANGELOG entry, since nothing under src/ changed.

Test plan

  • Hook passes on a clean index
  • With the new flag, a staged, unformatted file marked skip-worktree and removed from disk blocks the commit; the old hook let it through (tested in simple-excel, where the hook is byte-identical)

Copilot AI 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.

🟢 Approval recommended

The focused change correctly handles sparse index entries and remains synchronized across repositories.

0 open findings

What changed in this PR

Updates the pre-commit snapshot to include skip-worktree entries, ensuring sparse-checkout files are formatted and linted.

Changes:

  • Exports all index entries with --ignore-skip-worktree-bits.
  • Documents the sparse-checkout behavior.
  • Keeps all four shared hook copies identical.
File Description
.githooks/​pre-commit Includes skip-worktree files in the validation snapshot.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants