Skip to content
Source
Sign inSign up
TanStack/source

Stacked pull requests: change a pull request's base with src pr edit --base, and fill other stack gaps #118

Closedtombeckenham opened this issue 1 comment
tombeckenhamcommented

Building the #106 stack (#107 to #117) showed gaps in how src handles stacked pull requests.

What works now

  • src pr create --base <branch> opens a pull request on another pull request's branch and links it into a stack.
  • src pr stack view|link|unlink|break show and manage a stack.
  • The forge keeps a stack in sync: a push to a lower pull request is merged into each one above it ("Merge #108 into #109 (stack sync)").

What's missing

  1. Change a pull request's base. src pr edit <n> --base <branch> answers "not supported yet". gh has gh pr edit --base. Without it, a pull request can't be moved within a stack or put on top of a new one: I had to close #112 and #114 and open #115 in their place, which loses the review history.
    • When the new base is another pull request's branch, link the pull request into that stack, and run the stack sync so the new base is merged in.
    • REST and MCP need the same change (parity rules in AGENTS.md).
  2. Insert a pull request into the middle of a stack. Opening a pull request on #108's branch made a second branch of the stack (#114 next to #109), not a new layer. With 1, src pr edit 109 --base <new branch> fixes this. A src pr create --insert that does both steps would be better still.
  3. Close and delete the branch. src pr close --delete-branch is "not supported yet" (gh has it).
  4. A stack that branches. #112 and #113 were both on #111, and src pr stack view shows only one path. It should show both, or warn that the stack forks.

Done when

  • src pr edit --base, REST and MCP change the base, and relink the stack when the base is a stacked pull request's branch.
  • src pr close --delete-branch works.
  • src pr stack view shows a forked stack.
  • The docs and the source agent skill describe each change, and SUPPORT.md is regenerated.
  1. Done in #127 (merged): src pr edit --base (also REST and MCP), src pr close --delete-branch, and forked stacks in src pr stack view.

  2. AlemTuzlak closed this

Sign in to join this conversation.