Reputation: 1475
I'm not going to get a working solution but at least to get an answer if it is possible at all by Stash/Bitbucket. So my request is: We need to deploy some policy for ourselves in the company not to allow engineer to commit if commit comment does not contain (best does not begin with) JIRA issue number. For instance:
TEST-1234 (Jira under which I'm doing a commit) Here's my code
Thank you in advance!
Upvotes: 1
Views: 352
Reputation: 5167
tl;dr use the add-on Yet Another Commit Checker to enforce a regex, e.g. [A-Z][A-Z]+-[0-9]+ .*
Don't try to install your own script hooks via the on disk git repositories in Bitbucket Server. This can be done, but it's a) painful to audit (people have done this sort of thing, forgotten, and lost weeks trying to troubleshoot Bitbucket not knowing that git repos had been manually tampered with on disk) and b) dangerous, because Bitbucket Server intentionally applies a lot of specialised configuration and expects that end users are not messing around with the raw git repos on disk.
For what it's worth, I work for Atlassian's Premier Support team and supported Bitbucket Server for two years. You will be much, much better off with Yet Another Commit Checker.
Upvotes: 1