You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: enforce isolated worktrees for feature work
The main checkout kept accumulating in-flight work from concurrent
sessions. Three defects made that unavoidable:
- `.worktrees/` was never gitignored, even though validate-docs.py
already excluded it. A nested .git directory stages as a gitlink and
silently corrupts history.
- `install-hooks.sh` resolved hooks via `--git-dir`, which points at the
per-worktree directory with no `hooks/`, so it failed outright inside
a worktree.
- A global `core.hooksPath` silently overrode the repo-local hook, so
the origin guard never actually ran.
Add `worktree.sh` to create, list, retire, and prune worktrees branched
from a freshly fetched projectbluefin/testing. Branch retirement is
resolved through the forge because squash merges leave no ancestry for
`git branch --merged` to find.
Extend the pre-push hook to refuse feature-branch pushes from the main
checkout, overridable with SKIP_WORKTREE_GUARD=1. Install hooks into the
common git dir and, when core.hooksPath is overridden, redirect it
locally while shimming every unmanaged global hook so it still runs.
Assisted-by: Claude Opus 5 via GitHub Copilot CLI
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
description: Keep the main checkout clean by doing all feature work in isolated git worktrees. Use before starting any change, or when the tree is dirty.
4
+
metadata:
5
+
source-of-truth:
6
+
- .github/scripts/worktree.sh
7
+
- .github/scripts/install-hooks.sh
8
+
- .gitignore
9
+
---
10
+
11
+
# Worktrees
12
+
13
+
## Use when
14
+
15
+
- Starting any change that is not a one-line fix on `testing`.
16
+
- The main checkout is dirty, on a stale feature branch, or holds another
17
+
task's work in progress.
18
+
- Running an agent: every agent session gets its own worktree so concurrent
19
+
sessions cannot collide in the same working tree.
20
+
21
+
## Do not use when
22
+
23
+
- You are already inside a linked worktree. Check first:
0 commit comments