Skip to content

docs: Add parallel worktrees guide#1305

Open
ed-irl wants to merge 4 commits into
ed-irl/repo-exclusivefrom
ed-irl/anchor-guide
Open

docs: Add parallel worktrees guide#1305
ed-irl wants to merge 4 commits into
ed-irl/repo-exclusivefrom
ed-irl/anchor-guide

Conversation

@ed-irl

@ed-irl ed-irl commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Add a guide page (guide/worktrees.md) covering git-spice's parallel worktree model, and link it into the documentation navigation.

The page documents two halves of the model:

  • Anchors — how root and internal anchors let many worktrees share one stack in parallel, plus creating worktrees (gs anchor create), dependent worktrees via --anchor, and managing them with gs anchor list/track/rm.
  • Exclusive mode — how gs repo park/restore hand the whole repository to one process for stack reorganization, including the durable manifest, interrupt-resume behavior, recovery when a parked branch is deleted, and the one-shot gs repo exclusive -- <cmd> wrapper.

ed-irl added 3 commits June 23, 2026 13:48
Update the worktrees guide to match recent anchor and park/restore behavior:

- anchor list: describe it as listing registered anchors, the owning
  worktree, and whether each is a root or internal anchor.
- anchor rm / anchor track: note that a worktree cannot remove itself
  (run from another worktree) and may own only one anchor.
- park manifest: record that it now also stores each worktree's HEAD
  commit, and that a detached-HEAD worktree is restored at that commit.
- restore: document recovery when a reorganization deletes or renames a
  parked branch — restore keeps every other worktree, stays in
  exclusive mode, and reports the missing branch; recover by re-creating
  it and re-running restore, or discard with `gs repo restore --forget
  <path>`. Parked commits are preserved under refs/gs-park/ so they
  survive garbage collection until recovered.
Regenerates the sync RestackHandler mock so RestackBranch takes the
opts *restack.Options parameter introduced downstack. The mock had
been generated against the old two-argument signature.
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.

1 participant