Skip to content

hooks: register Entire as a Git config-based hook on Git 2.54+ #2580

Open

Description

@peyton-alt

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-push gets origin <url> and one ref line on stdin, and post-rewrite gets amend and one rewrite pair.
  • hook.<name>.enabled=false disables 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

Open design questions

  1. Mixed git versions on one repo. A GUI client with an older bundled git ignores hook.* config. If Entire drops its .git/hooks files 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/hooks copy skip when the running git honours config hooks, or accept dedup at the handler level.
  2. Coexistence with the Lefthook integration. On 2.54+, Entire should probably stop registering in lefthook-local.yml, or every hook runs twice.
  3. Scope. Local repo config (git config --local), matching per-clone .git/hooks today. Worktrees share .git/config, so check extensions.worktreeConfig and linked-worktree behaviour.
  4. Migration and uninstall. Moving existing installs, entire disable --uninstall, and doctor --force all need to learn the new location. GIT_DIR/-C hook environments behave as today.
  5. Detection. Decide on a git --version check (the approach fix(hooks): register Entire with Lefthook instead of owning its hook files #2388 uses for hk's warning) versus probing git 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

Activity

  1. modelpath-dev commented on Sep 27, 2026

    @modelpath-dev

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions