Skip to content

#110 docs: pre-commit installed in the main checkout; install only there - #128

Merged
gregoryfoster merged 3 commits into
mainfrom
110-precommit-agents
Nov 17, 2026
Merged

gregoryfoster merged 3 commits into
mainfrom
110-precommit-agents

Conversation

@gregoryfoster

Copy link
Copy Markdown
Member

Closes #110

Change

  • AGENTS.md (Environment & Tooling; Common Commands): pre-commit is installed in the main checkout, worktrees share its .git/hooks, and install is run from the main checkout only.
  • .pre-commit-config.yaml: the install comment says the same.

Why "only from the main checkout" (measured)

pre-commit install writes INSTALL_PYTHON=<venv it ran in> into the shared .git/hooks/pre-commit. I ran it from a throwaway worktree and then removed that worktree. After that, every commit was refused with `pre-commit` not found, because there's no pre-commit on PATH. Reinstalling from the main checkout fixed it.

Done outside the tree (main checkout)

  • Before: core.hooksPath unset; .git/hooks held samples only.
  • After uv run pre-commit install (pre-commit 4.7.0): .git/hooks/pre-commit exists, INSTALL_PYTHON=/home/exedev/status/.venv/bin/python, and core.hooksPath is still unset. No pre-push hook is installed, since the config has no default_install_hook_types.
  • A worktree commit with a deliberate ruff error (unused import after code: E402, F401, format) was refused with rc=1 and HEAD unchanged. A clean commit passed. Both worktrees were thrown away.

Refresh hook (managing-skills at bd6aaa2c)

  • With merge_mode pr, _pr_refresh builds the bump with git commit-tree (L2733) and exits at L2758. The direct-mode git commit (L2866) is never reached, so pre-commit can't run inside the refresh hook.
  • Its only git-hook exposure is the git push (L2573), which runs pre-push. None is installed.
  • I'm confirming it after the next first-of-day session on main, with no kill or back-off in .git/skills-update.log.

Docs-only. No tests changed and no deploy.

🤖 Generated with Claude Code

gregoryfoster and others added 3 commits November 17, 2026 17:24
… there

The main checkout now has .git/hooks/pre-commit (ruff check, ruff format
--check); worktrees share it. `pre-commit install` run from a worktree pins
that worktree's venv into the shared hook, so removing the worktree refuses
every commit until reinstalled from the main checkout (measured).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… sentence

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregoryfoster
gregoryfoster merged commit 776d091 into main Nov 17, 2026
3 checks passed
@gregoryfoster
gregoryfoster deleted the 110-precommit-agents branch November 17, 2026 17:55
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.

Main checkout has no pre-commit hooks installed (AGENTS.md says once per clone)

1 participant