I am try to control commit messages by enforcing developers to use particular JIRA ID in their commit message, but when I go to Hooks in settings and then push check plugin. The push is getting rejected as the commit message is not matching the given regular expression.
I want to commit message to have G1990 in it.
Can someone help me in this?
I guess you have to use .*G1990.* .
It is not contains check, it is must match check. So when we give (G1990) as regex, the commit which have only G1990 as message will be accepted and other commits will be rejected even when we added single character.
On the other hand, .*G1990.* , allow all the commits which contains G1990, because .(dot) means any character and *(asterisk) means anytime. Basically we are telling that commit message can have any char at n number of times before and after G1990.
Please let me know, if my answer helps you.
Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster ! While we’re all excited about the new improvements to Bitbucket ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events