Skip to content

fix(hooks): self-updating pre-commit hook#288

Merged
kumaakh merged 1 commit into
mainfrom
fix/self-updating-hook
May 29, 2026
Merged

fix(hooks): self-updating pre-commit hook#288
kumaakh merged 1 commit into
mainfrom
fix/self-updating-hook

Conversation

@kumaakh
Copy link
Copy Markdown
Contributor

@kumaakh kumaakh commented May 29, 2026

Summary

Adds a self-update check (Part 0) to the pre-commit hook. On every commit, the
hook compares the mtime of .github/hooks/pre-commit against the installed
.git/hooks/pre-commit. If the source is newer, it copies itself, re-chmod, and
re-execs -- so developers on existing clones silently get hook updates after a
git pull, with no manual npm install required.

Why

The llms-full.txt regen (Part 2) was added to .github/hooks/pre-commit but
fleet-dev had a stale installed hook that predated it, causing llms-full.txt to
fall out of sync without any warning. This fix makes the hook self-healing.

Test plan

  • Modify .github/hooks/pre-commit, touch a .md file, git commit -- confirm
    "pre-commit: hook updated" message appears before the commit proceeds
  • Second commit without changing the hook -- confirm no self-update message

@kumaakh kumaakh merged commit eab2ba3 into main May 29, 2026
3 checks passed
@kumaakh kumaakh deleted the fix/self-updating-hook branch May 29, 2026 18:15
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.

1 participant