Add "Commit message for default branch" regex option
Problem to solve
I want to have strict rules on commit messages pushed to the default branch, but no rules or very loose rules for commits pushed to feature branches.
Target audience
Release Manager & Developers
Further details
Currently I can define a regex to require that a commit message meets certain criteria, but this requirement is applied to all commit messages whereas since the merge request will contain enough information or will be squashed anyway I don't care about the individual commit messages on feature branches and so do not want to enforce the same requirements. For example if a hotfix is pushed straight to master it should reference a GitLab issue, Sentry issue, or some other report but if it is pushed to a feature branch it doesn't need to reference anything.
Proposal
Under Settings > Respository > Push Rules add a new field titled "Commit message on default branch" which behaves just like "Commit message" but only applies to the default branch instead of all branches. This will be 100% backward compatible and not require any migration.
What does success look like, and how can we measure that?
Anyone using this new config field will likely have benefited from it being available.