Skip to content

Draft: Add rebase option to UserMergeToRef

What does this MR do

This adds an option to perform a rebase prior to performing the merge, effectively turning it in to a semi-linear merge. This is part of supporting semi-linear merges for merge trains.

Background

Currently, merge trains only support the "merge commit" merge method. They do not support semi-linear or fast-forward merges.

Merge trains work by building a "candidate ref" of the changes in the order they would be merged. Each merge request on the merge train has its own merge train ref, refs/merge-requests/:iid/train. In order to support ff/semi-linear merges, we need to simulate what the user would do in this scenario, i.e. build each ref by rebasing on top of the previous train car's ref, and optionally adding a merge commit.

This MR adds the an optional rebase to the UserMergeToRef operation, allowing us to build the merge train refs using sequential rebase + merge commit operations.

Related issues

gitlab#413103 (closed)

Edited by Hordur Freyr Yngvason

Merge request reports