Skip to content

feat(worktree): add worktree management commands and per-worktree trunks#1170

Open
ed-irl wants to merge 2 commits into
ed-irl/scriptrunfrom
ed-irl/ai-message-gen
Open

feat(worktree): add worktree management commands and per-worktree trunks#1170
ed-irl wants to merge 2 commits into
ed-irl/scriptrunfrom
ed-irl/ai-message-gen

Conversation

@ed-irl

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

Copy link
Copy Markdown
Collaborator

Adds gs worktree create and gs worktree list, plus worktree-aware filtering across the log and restack commands.

Per-worktree trunks

gs worktree create <path> sets up a new worktree with its own local trunk branch (named after the directory, or via --trunk) that tracks the same remote ref as the canonical trunk. Stacks created in a worktree base on this branch, so gs repo sync and restacks in different worktrees no longer contend on a single shared trunk checkout. -b/--branch also creates a tracked branch stacked on the worktree trunk; --no-trunk keeps the legacy detached-HEAD behavior.

The registry lives in a new, additive worktree-trunks state key — older binaries and pre-existing repos simply see no entry. Store.IsTrunk/TrunkFor treat registered worktree trunks as trunk-equivalents, and BranchGraph traversals (Bottom, Downstack, etc.) now stop at any trunk, not just the canonical one.

Worktree-scoped filtering

-w/--worktree on log short/log long and repo restack limits output to stacks with a branch checked out in the current worktree, via the new BranchGraph.StacksInWorktree. repo restack gains an internal SkipCheckout so it can filter without forcing a checkout.

Test plan

  • Store unit tests: registry round-trip, reopen persistence, trunk-as-graph-root, canonical-trunk rejection
  • BranchGraph unit test: worktree trunk terminates traversal
  • Test scripts: worktree create/list, log short -w and repo restack -w filtering, branch create/restack when trunk lives in another worktree
  • mise run generate for help/docs

@ed-irl

ed-irl commented May 18, 2026

Copy link
Copy Markdown
Collaborator Author

@ed-irl ed-irl changed the base branch from main to ed-irl/scriptrun June 2, 2026 18:57
@ed-irl ed-irl force-pushed the ed-irl/ai-message-gen branch 3 times, most recently from 1ad5a37 to f63a0de Compare June 2, 2026 22:28
@ed-irl ed-irl force-pushed the ed-irl/scriptrun branch from 0c984c4 to 5d13e29 Compare June 8, 2026 10:18
@ed-irl ed-irl force-pushed the ed-irl/ai-message-gen branch from f63a0de to e02ef88 Compare June 8, 2026 10:18
@ed-irl ed-irl force-pushed the ed-irl/scriptrun branch from 5d13e29 to 3e9d081 Compare June 12, 2026 20:07
@ed-irl ed-irl force-pushed the ed-irl/ai-message-gen branch from e02ef88 to aff35c2 Compare June 12, 2026 20:07
@ed-irl ed-irl force-pushed the ed-irl/scriptrun branch from 3e9d081 to 1373b7f Compare June 13, 2026 13:39
@ed-irl ed-irl force-pushed the ed-irl/ai-message-gen branch from aff35c2 to f1ce6f6 Compare June 13, 2026 13:39
@ed-irl ed-irl force-pushed the ed-irl/scriptrun branch from 1373b7f to 4cbacbc Compare June 15, 2026 09:52
@ed-irl ed-irl force-pushed the ed-irl/ai-message-gen branch from f1ce6f6 to 96b120c Compare June 15, 2026 09:52
@ed-irl ed-irl force-pushed the ed-irl/scriptrun branch from 4cbacbc to f700687 Compare June 19, 2026 01:01
@ed-irl ed-irl changed the title feat: add AI message generation feature feat(worktree): add worktree management commands and per-worktree trunks Jun 19, 2026
@ed-irl ed-irl force-pushed the ed-irl/ai-message-gen branch from db800b9 to 378e4e4 Compare June 19, 2026 01:02
@ed-irl ed-irl force-pushed the ed-irl/scriptrun branch from f700687 to 3601ecc Compare June 24, 2026 01:31
@ed-irl ed-irl force-pushed the ed-irl/ai-message-gen branch from 378e4e4 to 1b093b5 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