Skip to content

feat(worktree): Add worktree commands, per-worktree trunks, and worktree-aware filtering#1183

Draft
ed-irl wants to merge 3 commits into
ed-irl/submodule-recurse-initfrom
ed-irl/submodule-recurse
Draft

feat(worktree): Add worktree commands, per-worktree trunks, and worktree-aware filtering#1183
ed-irl wants to merge 3 commits into
ed-irl/submodule-recurse-initfrom
ed-irl/submodule-recurse

Conversation

@ed-irl

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

Copy link
Copy Markdown
Collaborator

Add 'gs worktree create' and 'gs worktree list'. By default 'worktree create' sets up a per-worktree trunk: a local branch tracking the same remote ref as the canonical trunk, so sync and restack in different worktrees never contend on a shared trunk checkout. --no-trunk preserves detached-HEAD behavior; -b stacks a tracked branch on the worktree trunk.

State gains a worktree-trunk registry (state/worktree.go) persisted under an additive, optional key. Store.IsTrunk now treats any registered worktree trunk as a graph root, and TrunkFor resolves the trunk for a given worktree. BranchGraph carries the full trunk set so traversals (Bottom, Downstack) stop at worktree trunks, and StacksInWorktree yields complete stacks touching a worktree.

Add '-w/--worktree' to 'log short' and 'repo restack' to scope output and restacking to the current worktree's stacks. Sync pulls the canonical remote trunk into the worktree's local trunk.

@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from 8045352 to 1d40074 Compare June 2, 2026 18:57
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse branch 2 times, most recently from 2fc4138 to c978ecb Compare June 2, 2026 20:05
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from 574e522 to 7cbf48b Compare June 2, 2026 20:13
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse branch from c978ecb to 5659335 Compare June 2, 2026 22:29
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch 2 times, most recently from 66cca89 to 39a8932 Compare June 8, 2026 10:18
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse branch from 5659335 to 9750332 Compare June 8, 2026 10:18
@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-recurse branch from 9750332 to 4bde27c Compare June 8, 2026 10:39
@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-recurse branch from 4bde27c to d52f52b Compare June 12, 2026 20:05
@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-recurse branch from d52f52b to f41c960 Compare June 13, 2026 13:38
@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-recurse branch from f41c960 to 388d500 Compare June 15, 2026 09:52
@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 changed the title submodule: --recurse-submodules for gs stack restack 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 branch from 82ec319 to 0f93a50 Compare June 19, 2026 01:00
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse-init branch from 7246c35 to 4f82ef2 Compare June 24, 2026 01:31
@ed-irl ed-irl force-pushed the ed-irl/submodule-recurse branch from 7192737 to 3ec5321 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