Skip to content

Allow to revert/cherry-pick squashed MRs with FF strategy

What does this MR do and why?

Contributes to #22236 (closed)

Problem

Fast-forward MR strategy doesn't create a merge commit. That hides revert/cherry-pick button on the merge request, because there is no merge commit related to the merge request.

However, this functionality should be available when the merge request was squashed or it had only one commit.

Solution

Use squash_commit or a single commit as a point for revert/cherry pick.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-01-18_at_17.41.20 Screenshot_2024-01-18_at_17.40.17

How to set up and validate locally

  1. Go to the project Settings -> Merge requests
  2. Set "Fast-forward merge"
  3. Click "Save changes"
  4. Create a merge request with 2 commits
  5. Go to the merge request page
  6. Select "Squash commit" option and click on "Merge" button
  7. After page reload click on "Revert" button
  8. You should be able to create a revert MR
Edited by Vasilii Iakliushin

Merge request reports