Prevent me (totte) from forgetting to reference issues in commits
As part of the workflow suggested here, it would be wise for me to get into the habit of working with and referencing issues. So far it's been difficult to remember though, and I'd appreciate assistance by e.g. push rules, as described here:
Let’s assume you have the following requirements for your workflow:
- every commit should reference a Jira issue, for example:
Refactored css. Fixes JIRA-123.
- users should not be able to remove Git tags with
All you need to do is write a simple regular expression that requires the mention of a Jira issue in the commit message, like
Now when a user tries to push a commit with a message
Bugfix, their push will be declined. Only pushing commits with messages like
Bugfix according to JIRA-123will be accepted.