Skip to content

FEAT-22: feat(stack): stacked-branch / stacked-PR support #1953

Description

@gfargo

Category: command
Gap: No notion of a branch stack. grep -rni "stacked|prStack" finds only history row rendering modes and repoStackRuntime.ts (multi-repo navigation, unrelated). ForgeActions.createPullRequest takes a single base, and nothing tracks parent/child relationships or restacks children after a parent rebase.
Why it matters: Stacked development is where Graphite, git-town, and spr have carved out real adoption, and it is a workflow AI helps with disproportionately — decomposing a large change into a stack is exactly what commit --split already does one level down. This is the most differentiating bet in this report.
Sketch: Add src/git/stackData.ts + stackActions.ts storing parent pointers in git config (branch.<name>.coco-parent, no new files, survives clone-independently), a stack workstation surface, and coco stack {create,restack,submit,status} where submit walks the stack calling ForgeActions.createPullRequest with each branch's parent as base. Reuse commitSplit planning to propose a stack from a large working set.
Already-there leverage: branchData.ts/branchActions.ts, rebaseActions.ts/rebasePlanActions.ts, worktreeActions.ts, the split planner, and the multi-row surface pattern are all shipped. configFiles.ts already reads/writes git config sections.
Effort notes / risks: L and genuinely risky — restack-after-rebase is where every stacking tool accumulates its bug reports, and conflict handling mid-restack must integrate with the (currently unimplemented) coco resolve work. Sequence after P0-1. Large new surface area for the keymap.


Extracted from a repo audit performed 2026-07 (the audit doc it came from was proposed via an unmerged docs PR).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions