Skip to content

docs(git-hooks): document CaptainHook + git-worktree workaround#31

Merged
CybotTM merged 3 commits into
mainfrom
docs/captainhook-worktree-workaround
Apr 22, 2026
Merged

docs(git-hooks): document CaptainHook + git-worktree workaround#31
CybotTM merged 3 commits into
mainfrom
docs/captainhook-worktree-workaround

Conversation

@CybotTM

@CybotTM CybotTM commented Apr 21, 2026

Copy link
Copy Markdown
Member

Summary

captainhook/hook-installer fails in secondary git worktrees because .git is a pointer file (gitdir: /path/to/bare/worktrees/NAME), not a directory. The resolver in captainhook ≤ 1.x chokes on the pointer and aborts composer install:

In ComposerPlugin.php line 178:
  Shiver me timbers! CaptainHook could not install yer git hooks! (invalid .git path)

The netresearch/typo3-ci-workflows meta-package README already documents this, but the git-workflow skill's own references/git-hooks-setup.md — which explicitly lists captainhook as a supported framework — never mentioned the failure mode. This PR closes that gap.

Changes

  • references/git-hooks-setup.md: New Troubleshooting section with a CaptainHook + git worktrees (FAQ) entry covering symptom, cause, recommended fix (composer install --no-plugins), alternative fix (pre-create hooks dir via git rev-parse --git-dir), and cross-reference to the canonical workaround in netresearch/typo3-ci-workflows.
  • SKILL.md: Extended the skill description with git hooks framework keywords (lefthook, captainhook, husky, pre-commit) and a "hook-install failures in git worktrees" trigger phrase so the skill actually activates on this class of problem.
  • checkpoints.yaml: New GW-14a (info-level) — detects captainhook/hook-installer in composer.json and reminds projects to document the worktree workaround in their README.

Real-world context

Encountered repeatedly during t3x-nr-vault release work. The Netresearch bare-repo + worktrees convention (documented in the user's global CLAUDE.md under "Git Worktree Convention") means every composer install in a feature-branch worktree hit this error. The fix was already known; it just wasn't where an agent reading the git-workflow skill would find it.

Test plan

  • references/git-hooks-setup.md renders with new Troubleshooting section; bullets and backticks balanced
  • SKILL.md frontmatter still valid YAML after description extension
  • checkpoints.yaml parses — GW-14a follows same contains pattern as GW-02/GW-03
  • Files end with a single \n (no trailing blank lines → yamllint empty-lines clean)
  • Commit signed (GPG/SSH) + DCO sign-off present

`captainhook/hook-installer` fails in secondary git worktrees because
`.git` is a pointer file, not a directory. This adds a Troubleshooting
section to `references/git-hooks-setup.md` covering the symptom, cause,
and two known fixes (`composer install --no-plugins` preferred;
pre-creating the hooks dir as fallback).

Also:
- Extend the skill description with "git hooks" and "worktrees" triggers
  so the skill activates on hook-install failures in worktree-based repos.
- Add checkpoint GW-14a: info-level reminder for projects that depend on
  `captainhook/hook-installer` to document the worktree workaround in their
  README.

Context: encountered repeatedly during t3x-nr-vault release work, where
every `composer install` in a feature-branch worktree tripped the same
error. Canonical workaround lives in `netresearch/typo3-ci-workflows`
README, but the skill's own hook docs never mentioned it.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copilot AI review requested due to automatic review settings April 21, 2026 23:36
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation and skill metadata to better support git hook frameworks—specifically documenting and detecting the CaptainHook failure mode in secondary git worktrees—so agents/users can diagnose and apply the known workaround.

Changes:

  • Added a Troubleshooting section to the git hooks setup reference covering CaptainHook + git worktrees.
  • Expanded skill trigger/description keywords to include common hook frameworks and worktree hook-install failures.
  • Added a new checkpoint to detect captainhook/hook-installer in composer.json and prompt documenting the workaround.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
skills/git-workflow/references/git-hooks-setup.md Documents CaptainHook worktree install failure and workarounds in a new Troubleshooting section.
skills/git-workflow/checkpoints.yaml Adds checkpoint GW-14a to detect captainhook installer usage and remind to document the worktree workaround.
skills/git-workflow/SKILL.md Updates skill description to better match hook-framework and worktree troubleshooting queries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/git-workflow/references/git-hooks-setup.md Outdated
Comment thread skills/git-workflow/references/git-hooks-setup.md Outdated
Comment thread skills/git-workflow/references/git-hooks-setup.md Outdated
Comment thread skills/git-workflow/checkpoints.yaml Outdated
CybotTM added 2 commits April 22, 2026 01:45
yamllint fails on lines > 160 chars. The GW-14a checkpoint description
exceeded that after a single-line JSON-style 'desc:'. Switch to block
scalar (>-) so the long guidance line can wrap without yamllint noise
and without changing the rendered string.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
- Lead with hooks-dir workaround using git rev-parse --git-path hooks
  which honors core.hooksPath if configured (no branching needed).
- Demote composer install --no-plugins to last-resort fallback and
  spell out the side effects (phpstan/extension-installer,
  TYPO3 composer installers, captainhook itself won't register).
- Drop reference to user's private global CLAUDE.md; link to
  git-worktree(1) upstream docs instead.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@CybotTM CybotTM merged commit 8129432 into main Apr 22, 2026
12 checks passed
@CybotTM CybotTM deleted the docs/captainhook-worktree-workaround branch April 22, 2026 00:01
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.

2 participants