Skip to content

feat: wt create --pr <n> — a worktree on a PR's head branch - #63

Merged
sahil-noon merged 4 commits into
mainfrom
261123-c3ek-create-pr-head-worktree
Nov 23, 2026
Merged

sahil-noon merged 4 commits into
mainfrom
261123-c3ek-create-pr-head-worktree

Conversation

@sahil-noon

@sahil-noon sahil-noon commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Meta

Change ID Type Confidence Plan Review
c3ek feat 4.5/5.0 4/4 tasks, 13/13 acceptance ✓ ✓ 2 cycles
Impact +/− Net
raw +1172 / −14 +1158
true +499 / −6 +493
└ impl +192 / −6 +186
└ tests +307 / −0 +307

excludes fab/, docs/ · generated by fab-kit v2.31.0

Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship ✓

Summary

Adds wt create --pr <n>: resolves a pull request's head branch with gh pr view <n> --json headRefName,isCrossRepository (15 s timeout) and runs the existing --checkout <head> path, so PR-surgery worktrees no longer need a hand-rolled gh lookup. Fork PRs exit 2; a missing or failing gh exits 1. Step W4 of plan fab/plans/sahil/26-11-23-worktree-base-receipts.md.

Changes

  • New flag --pr <n> on wt create (src/cmd/wt/create.go)
  • Mutual exclusion with positional, --base, --checkout, --reuse
  • PR-head resolution in src/internal/worktree/pr.go (ResolvePRHead, ErrGhNotFound, ErrPRCrossRepository)
  • Wiring in create.go (lookup before any mutation, From: PR #<n> (existing branch '<head>'))
  • Tests: unit (stub gh on PATH), binary-level, integration against a bare origin
  • Docs: cli-surface.md, wt skill bundle

🤖 Generated with Claude Code

@sahil-noon
sahil-noon marked this pull request as ready for review November 23, 2026 16:09
@sahil-noon
sahil-noon force-pushed the 261123-c3ek-create-pr-head-worktree branch from bdc183d to 723bc08 Compare November 23, 2026 16:12
@sahil-noon
sahil-noon merged commit 3373b71 into main Nov 23, 2026
2 checks passed
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.

2 participants