At #2205815: Merge requests in Drupal.org issue queues?, I wrote:
How do maintainers enable no-fast-forward (
--no-ffor merge) commits? When I went to merge an MR recently, it said it was going to be a fast-forward commit, and there didn't appear to be a way to change it, which is actually the default Gitlab behaviour.Merge commits are good because the provide contextual metadata:
- they package the associated commits together, and allow folks to reference the issue and MR from looking at the tree (if, say, committers forgot to mention the ticket number in the message), and
- the entire MR can be reverted at once without having to deal with finding the individual commits and reverting those (which is very time consuming).
If it can't be the default behaviour, can there at least be an option to change it?
And then @drumm responded:
Yes, please do open a child issue for this. To minimize disruption, the default merge strategy is set to mirror the patch workflow as much as possible. There isn’t going to be one single best merge strategy for every project, so we should provide the options. #3072047: Handle merging of merge requests has some details on the current implementation.
This is that child issue. :)
Upstream blockers
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Screen Shot 2021-01-05 at 5.24.48 PM.png | 115.36 KB | drumm |
| #2 | Screen Shot 2021-01-05 at 5.23.16 PM.png | 95.97 KB | drumm |
Comments
Comment #2
drummGitLab currently has 3 options:
There are also options for squashing:
However, we can’t set those for a project yet, https://gitlab.com/gitlab-org/gitlab/-/issues/261458. This still may be a useful setting for doing the merges via Drupal.org, we can specify squashing with each individual merging.
I think the merge UI on Drupal.org’s issue pages should respect these options. To reduce the number of API requests to GitLab during a merge, we should store a copy of each setting in fields for each project node. (Especially since we can’t set the project’s squashing behavior via GitLab’s API.)
Comment #3
colanProjects API show whether a project requires/prevents squashing is now in. Are there any other upstream blockers we should be tracking here?
Comment #4
drummI believe that’s only for showing the data, not modifying it. https://gitlab.com/gitlab-org/gitlab/-/issues/333945 remains open for the option to change the merge strategy.
Comment #5
colanAdded these to the IS.
Comment #6
drummGitLab 15.4 has moved the merge options, so they are now available to be set: https://about.gitlab.com/releases/2022/09/22/gitlab-15-4-released/#dedic...
Go directly to “Merge requests” under the project settings.