Skip to content

feat(worktree): add worktree commands, per-worktree trunks, and worktree-aware filtering#1182

Draft
ed-irl wants to merge 3 commits into
ed-irl/submodule-commit-pointerfrom
ed-irl/submodule-recurse-init
Draft

feat(worktree): add worktree commands, per-worktree trunks, and worktree-aware filtering#1182
ed-irl wants to merge 3 commits into
ed-irl/submodule-commit-pointerfrom
ed-irl/submodule-recurse-init

Conversation

@ed-irl

@ed-irl ed-irl commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Add gs worktree create and gs worktree list.

worktree create sets up a per-worktree trunk: a local branch (named
after the worktree directory, or set with --trunk) that tracks the same
remote ref as the canonical trunk. Stacks created in the worktree are
based on this branch, so repo sync and restacks in different worktrees
never contend on a single shared trunk checkout. Use -b to also create a
tracked branch on the worktree trunk, or --no-trunk for the legacy
detached-HEAD behavior.

The state store gains a per-worktree trunk registry (an additive,
optional key, so older repos and binaries are unaffected). Trunks are
resolved per-worktree via TrunkFor, and IsTrunk now treats every
registered worktree trunk as a graph root: traversals and the branch
graph stop at them, and they may not themselves be tracked or deleted.

Add -w/--worktree to log short and repo restack to scope output
and restacking to stacks with a branch checked out in the current
worktree, via BranchGraph.StacksInWorktree. The sync handler now
distinguishes the canonical remote trunk from the local worktree trunk
it pulls into, and restack gains WorktreeFilter and SkipCheckout.

@ed-irl ed-irl force-pushed the ed-irl/submodule-commit-pointer branch from b2e2972 to 7020d10 Compare June 2, 2026 18:57
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch 3 times, most recently from 7cbf48b to 66cca89 Compare June 2, 2026 22:31
@ed-irl ed-irl force-pushed the ed-irl/submodule-commit-pointer branch 2 times, most recently from 73b4f4c to e6f5a36 Compare June 8, 2026 10:18
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from 66cca89 to 39a8932 Compare June 8, 2026 10:18
@ed-irl ed-irl force-pushed the ed-irl/submodule-commit-pointer branch from e6f5a36 to 3a64ff4 Compare June 8, 2026 10:39
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from 39a8932 to 2671243 Compare June 8, 2026 10:39
@ed-irl ed-irl force-pushed the ed-irl/submodule-commit-pointer branch from 3a64ff4 to b96e1f7 Compare June 12, 2026 20:05
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from 2671243 to 763265d Compare June 12, 2026 20:05
@ed-irl ed-irl force-pushed the ed-irl/submodule-commit-pointer branch from b96e1f7 to e5977f3 Compare June 13, 2026 13:38
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from 763265d to fa376a3 Compare June 13, 2026 13:38
@ed-irl ed-irl force-pushed the ed-irl/submodule-commit-pointer branch from e5977f3 to 8d5549e Compare June 15, 2026 09:52
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from fa376a3 to df5a62e Compare June 15, 2026 09:52
@ed-irl ed-irl force-pushed the ed-irl/submodule-commit-pointer branch from 15ae428 to a9d8ed3 Compare June 19, 2026 00:59
@ed-irl ed-irl changed the title submodule: gs repo init --recurse-submodules feat(worktree): add worktree commands, per-worktree trunks, and worktree-aware filtering Jun 19, 2026
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from ed78147 to ca8ae7b Compare June 19, 2026 01:00
@ed-irl ed-irl force-pushed the ed-irl/submodule-commit-pointer branch from 7ad0991 to 454f625 Compare June 24, 2026 01:31
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from 7246c35 to 4f82ef2 Compare June 24, 2026 01:31
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