E.g. we want all commit messages to start with the issue number (e.g. '#1 (closed) Some commit'). Using a push rule we can enforce this, in case we forget. I think we'll have use for other push rules as well, e.g. for branch names.
How can we configure this? We don't seem to have any access to project settings.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
If I violate the rule, it is indeed rejected. However, the message is not very informative. It does not indicate which rule is violated or anything else that is helpful:
Previously, as part of this issue, you added for us the following regex for commit messages as push rule: ^#\d+ (.|\n)+$. This ensures that all commit messages must start with an issue number (syntactically at least). This is also a best practice as per the Eclipse Foundation Project Handbook (https://www.eclipse.org/projects/handbook/#resources-commit). The push rule is very useful as we otherwise may forgot to include it in the commit message.
We now noticed that this is very impractical for merge commits. When merging using the GitLab web UI, by default the message does not start with an issue number. You can however change the message and add it.
In other situations, e.g. when using Git to merge e.g. 'develop' into a branch for an issue, one also gets merge commits. These are created by Git (e.g. command line Git or EGit). EGit does not allow to change the message (option to modify the commit is missing in right-click menu of such commits). You can change the message via the amend feature, if it is the previous/last commit. But that is not very practical, and definitely not obvious to everyone.
Furthermore, for merge commits, as there are 2 parent commits, what should be the issue number? It may not be so clear.
A practical solution would be to also allow commit messages that start with Merge .
Could you please change the push rule commit message regex for the Eclipse ESCET project to ^(#\d+|Merge) (.|\n)+$.
I think allowing "Merge" as a prefix is a reasonable solution. An alternative could be to avoid merge commits altogether and only allow fast-forward merging.
I'll say that we should create a note within something like an FAQ page on this in the wiki. This way, future groups making these requests will be able to do so quicker and easier!
Project Leads have the role of maintainers. Maintainers are allowed to modify the push rules if I am not mistaken.
@ddennis I see that you have the Maintainer role for https://gitlab.eclipse.org/eclipse/escet/. Please let me know if you are unable to edit the push rules for this project.
I think we are done here! Please re-open if you think there is still work to do.