A merge request whose target branch is the source branch of another open merge request in the same repository is stacked on it. Targeting such a branch already works today; what is missing is everything that makes the stack usable after the bottom merges.
Design:
- Derived, not stored.
Bis stacked onAwhenB.target_ref == A.source_ref, both open, same repository. No new column, no new flag onmr create; the output ofmr createsaysstacked on !Awhen it applies. mr showgainsstacked_on(number, title, state) andstacked(the open merge requests targeting this one's source branch).mr listrows gainstacked_on. The web merge request page shows "stacked on !A" in the header and "!B builds on this" below it.- When
Amerges, every open merge request targetingA.source_refis retargeted toA.target_refwith a system comment naming the merge, before anything removes the source branch. Reviews are kept: the diff against the new target is the diff it was approved against. - That holds only when
A's commits reach the target unchanged. MergingAwith--strategy squashorrebasewhile it has stacked merge requests is refused with the stack named: merge withfformerge, or merge the stack top-down intoAfirst. - Closing
Awithout merging leaves the stack alone; its branch still exists. - Merging
BintoA's branch whileAis open is allowed. It collapsesBintoA, andA's head updates as on any push to its branch.
Test: a three-deep stack over SSH, merged bottom-up, each retarget landing with its comment and its reviews intact; the squash refusal; and the real thing, the v1.6.0 issues implemented as one stack of merge requests and merged in order.
Parity: a merge request row "stacked merge requests", cli yes, web read-only, ios no.
closed by commit 39535a8e16 by cmc: mr: stacked merge requests
2026-09-02 02:52 UTC