Allow merging an MR chain all at once
Proposal
I am proposing a feature where a chain of merge requests can be merged all at once to a target branch.
It is quite convenient to create a chain of merge requests to present / review multiple related but atomic commits as multiple merge requests. There are multiple tools to maintain merge-request-chains, for example git-chain.
It becomes quite cumbersome to merge multiple MRs, especially when CI takes 20+ minutes and merge-trains are enabled, because if you have e.g. 7 MRs, once approved, you would start merging from the bottom. So first you have to wait 20 minutes for the first MR to build, then another 20 minutes for the second one to build because of the branch change, then 20 more minutes when merging it, and so on. For seven MRs the time it takes to merge them all is (7 * 2 - 1) * 20 = 260 minutes .
It would be nice if it was possible to mark (or automatically identify) the MRs that are in a chain, and if they are all approved, be able to merge them together with one merge commit and the merge train would only run once, so the time save would be 240 minutes (!) for merging.
To illustrate, with a simpler example:
gitGraph
commit id: "initial"
branch my-chain-1
checkout my-chain-1
commit id: "1 (MR1)"
checkout main
commit id: "other work"
checkout my-chain-1
branch my-chain-2
checkout my-chain-2
commit id: "2 (MR2)"
branch my-chain-3
checkout my-chain-3
commit id: "3 (MR3)"
When merging today it looks like this
gitGraph
commit id: "initial"
branch my-chain-1
checkout my-chain-1
commit id: "1 (MR1)"
checkout main
commit id: "other work"
checkout my-chain-1
branch my-chain-2
checkout my-chain-2
commit id: "2 (MR2)"
branch my-chain-3
checkout my-chain-3
commit id: "3 (MR3)"
checkout main
merge my-chain-1 id: "merge-1"
merge my-chain-2 id: "merge-2"
merge my-chain-3 id: "merge-3"
But I would like for it to look like this
gitGraph
commit id: "initial"
branch my-chain-1
checkout my-chain-1
commit id: "1 (MR1)"
checkout main
commit id: "other work"
checkout my-chain-1
branch my-chain-2
checkout my-chain-2
commit id: "2 (MR2)"
branch my-chain-3
checkout my-chain-3
commit id: "3 (MR3)"
checkout main
merge my-chain-3 id: "merge-all"
After merging all the MRs together, each individual MR would be in the "Merged" state.