Rebase and merge with one click (#895) · Issues · GitLab.org / GitLab · GitLab (original) (raw)

Skip to content

Rebase and merge with one click

Problem

When using merge commit with semi-linear history and fast-forward merge methods, if the target branch has changed since the source branch was created or last rebased, the source branch will need to be rebased before merging in order to merge according to the selected merge method.

Currently, if GitLab detects a rebase is required, the users can click the Rebase button. Once the rebase is completed the Merge button will become available. This require more time as I have to return to MR to check when rebase is done and then merge.

Proposal

Now that FF-merge trains exists I think much of the implementation could also be re-used as follows (no Gitaly changes required):

  1. Use MergeRequests::CreateRefService to create a merge candidate ref, for example refs/merge-requests/:iid/rebase-merge
  2. Perform a fast-forward merge from refs/merge-requests/:iid/rebase-merge into the target branch. If the target branch has been updated in the meantime, this would gracefully fail (in which case we could retry or display an error to the user).

Further details


Old proposal

  1. No pipeline exists (No GitLab CI set up)
  1. Pipeline running
  1. Pipeline passed
  1. Pipeline failed

Customers

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited Oct 23, 2023 by 🤖 GitLab Bot 🤖