feat(hooks): one-command install-hooks.sh (worktree-safe) #170

Merged
clawdie merged 2 commits from fix/wiki-format-drift into main 2026-06-24 14:17:28 +02:00
Owner

Adds scripts/install-hooks.sh — one command to activate the pre-push gate (was a manual ln -sf per clone that's easy to skip), plus AGENTS.md / quality-gates pointer updates.

Review correction applied

The original installer symlinked a relative target (../../scripts/pre-push), which only resolves for a standard <repo>/.git/hooks layout — it breaks in git worktrees / custom git dirs (used by the agent harness) and assumed .git/hooks exists. Reworked to:

  • resolve the real hooks dir via git rev-parse --git-path hooks (worktree-safe),
  • mkdir -p it,
  • symlink to the absolute source path,
  • verify pre-push exists + is executable.

Tested

Installs cleanly; the link resolves to scripts/pre-push; idempotent. check-format + wiki-lint --strict green.

Honest caveat

Git hooks are inherently per-clone — this makes activation one command, but each clone/worktree still runs it once. The only fully-automatic gate is a Forgejo CI runner (still postponed). So this is opt-in safety, not server-side enforcement.

Note: the symbol-anchor lint check (verify cited (symbol) still exists, not just the file) is not in this branch — still open if you want it.

🤖 Generated with Claude Code

Adds `scripts/install-hooks.sh` — one command to activate the pre-push gate (was a manual `ln -sf` per clone that's easy to skip), plus AGENTS.md / quality-gates pointer updates. ## Review correction applied The original installer symlinked a **relative** target (`../../scripts/pre-push`), which only resolves for a standard `<repo>/.git/hooks` layout — it breaks in **git worktrees / custom git dirs** (used by the agent harness) and assumed `.git/hooks` exists. Reworked to: - resolve the real hooks dir via `git rev-parse --git-path hooks` (worktree-safe), - `mkdir -p` it, - symlink to the **absolute** source path, - verify `pre-push` exists + is executable. ## Tested Installs cleanly; the link resolves to `scripts/pre-push`; idempotent. `check-format` + `wiki-lint --strict` green. ## Honest caveat Git hooks are inherently **per-clone** — this makes activation one command, but each clone/worktree still runs it once. The only fully-automatic gate is a Forgejo CI runner (still postponed). So this is opt-in safety, not server-side enforcement. > Note: the **symbol-anchor lint check** (verify cited `(symbol)` still exists, not just the file) is *not* in this branch — still open if you want it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
clawdie added 2 commits 2026-06-24 14:13:30 +02:00
fix(hooks): make install-hooks robust for worktrees/custom git dirs
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
9f091454e5
The installer symlinked a RELATIVE target (../../scripts/pre-push), which only
resolves for a standard <repo>/.git/hooks layout — it breaks in git worktrees
or when .git is a file/elsewhere (both used by the agent harness), and assumed
.git/hooks already exists.

Resolve the real hooks dir via 'git rev-parse --git-path hooks' (worktree-safe),
mkdir -p it, and symlink to the ABSOLUTE source path so it works regardless of
where the hooks dir lives. Also verify pre-push exists + is executable.

Tested: installs, link resolves to scripts/pre-push, idempotent.
clawdie merged commit 45f83523c3 into main 2026-06-24 14:17:28 +02:00
clawdie deleted branch fix/wiki-format-drift 2026-06-24 14:17:29 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clawdie/colibri#170
No description provided.