"Squash-Rebase-and-Merge" as an available action

Problem to solve

We're a team that's currently using the "merge commit" setting for a repo. Changing to other "Merge request" settings is painful:

  • There are people who keep their MR branches up-to-date using git merge origin/master, preferring that over rebasing their branch because they don't have to re-resolve merge conflicts every time they integrate new changes from master, if an earlier integration from master did have a conflict. For example, within a feature branch, disabling some tests in one commit, then re-enabling tests in a later commit. For these people, the "Rebase" button in the Gitlab Web UI does the "wrong" thing for them.

  • Other people aren't very familiar with rebasing. They click the "Rebase" button in the Gitlab UI, but then they can't

  • Other people are really diligent about keeping their MR branches perfectly up-to-date with master by using git merge origin/master right before merging. It's burdensome on them to then also have to rebase, even when it would have

  • We want to use other "Merge request" settings because it helps making cherry-picking easier for maintenance release work.

Proposal

When the repo setting is "Merge commit with semi-linear history" or "Fast-forward merge"

And there is only one commit in the branch

In addition to a "Rebase" button

Have a "Rebase and Merge" button, which Rebases and Merges.


When the repo setting is "Merge commit with semi-linear history" or "Fast-forward merge"

And there are multiple commits on the branch

And the MR setting is "squash commits"

In addition to a "Rebase" button

Have a "Squash, Rebase and Merge" button, which squashes, then rebases and then merges.