Configurable defaults for "Squash commits" option
Squash and merge is a very useful feature, but is polarizing. Some teams it is the way every merge request should be handled, while other teams want it completely disabled because it would cause serious problems for their branching strategy, and many are happy to leave it up to the developer who creates the merge request. GitLab should make squash and merge a configurable option.
Original request from @davidarcher:
We love the new squash merge feature in GitLab and have updated our team's process documentation to tell devs to use it on every MR. However, they need to remember to check the box on every MR. It would be great if we could enforce this at the project level instead of relying on devs checking it on each and every MR.
Opposite request from @neemo157 on https://gitlab.com/gitlab-org/gitlab-ce/issues/49046:
This feature is super-useful and we use it in a lot of our repositories. However, we have at least 1 repository where we want to be very careful about maintaining history between a pair of branches, when we merge across from one to the other we have to keep the exact same commits to keep the history working correctly. Since we use this feature in other repositories it's far too tempting for our developers to press it all the time, which results in a new commit being created diverging the branches histories.
Proposal
- Add a drop down to to the project settings page Squashing commits before merging with the options
-
Never
(do not show the squash option, do not squash) -
Allowed
(default, current behavior, show the squash option, unchecked but user can enable) -
Enabled
(show the squash option, checked but user can disable) -
Always
(show the squash option, check and the user cannot disable)
-