Repository navigation
hooks: register Entire as a Git config-based hook on Git 2.54+ #2580
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Git 2.54 added config-based hooks (hook.<name>.event + hook.<name>.command). Git runs them in addition to the file in the hooks directory. On Git 2.54+ Entire could register its five hooks there instead of owning .git/hooks/*, which would end the ownership fights with every hook manager at once.
What was verified (Git 2.55.0, built from source; hk 2.1.0)
- A config hook and a
.git/hooks/<name>file for the same event both run. The config hook runs first. - Both receive the same arguments and the same stdin:
pre-pushgetsorigin <url>and one ref line on stdin, andpost-rewritegetsamendand one rewrite pair. hook.<name>.enabled=falsedisables a single entry.- hk 2.x already works this way (
hook.hk-pre-commit.command), and its hooks compose with Entire's native hooks with no interference.
Why it matters
- Lefthook (fix(hooks): register Entire with Lefthook instead of owning its hook files #2388): Entire currently runs as a Lefthook job, so
LEFTHOOK=0skips Entire too. Lefthook's launcher exits before reading any config, so a commit made that way is never linked to a checkpoint. A config hook isn't inside Lefthook's launcher, soLEFTHOOK=0couldn't skip it, and Lefthook's constant reclaiming of.git/hooks/*wouldn't matter. - Husky, pre-commit, Overcommit, legacy hk: these overwrite
.git/hooks/*at install time. Today Entire repairs that on the next agent turn, and commits made in between aren't captured. A config hook is never overwritten. statusanddoctordelivery checks (entire status reports "Checkpoints sync to: origin" when the git hooks are not installed #2264) get simpler, since nothing else writes where Entire registers.
Open design questions
- Mixed git versions on one repo. A GUI client with an older bundled git ignores
hook.*config. If Entire drops its.git/hooksfiles on 2.54+, those clients silently capture nothing. If it keeps both, Git 2.54+ runs Entire twice per event. Options: keep both and have the.git/hookscopy skip when the running git honours config hooks, or accept dedup at the handler level. - Coexistence with the Lefthook integration. On 2.54+, Entire should probably stop registering in
lefthook-local.yml, or every hook runs twice. - Scope. Local repo config (
git config --local), matching per-clone.git/hookstoday. Worktrees share.git/config, so checkextensions.worktreeConfigand linked-worktree behaviour. - Migration and uninstall. Moving existing installs,
entire disable --uninstall, anddoctor --forceall need to learn the new location.GIT_DIR/-Chook environments behave as today. - Detection. Decide on a
git --versioncheck (the approach fix(hooks): register Entire with Lefthook instead of owning its hook files #2388 uses for hk's warning) versus probinggit hook list <event>.
Related
#2264, #1349, #2263, #2388 (the LEFTHOOK=0 limitation is documented there), #2577 (the carry-forward fix for commits made with hooks skipped).
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
modelpath-dev commentedon Sep 27, 2026
Interesting proposal to use Git config-based hooks for Entire. I'd look into how it handles mixed Git versions across different clients, especially since older versions might not recognize the new hook setup.