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.
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
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