• Community
  • Products
  • Bitbucket
  • Questions
  • In Stash is there a way to enforce log message only to a select branches, for eg, a particular log format only for master/develop or staging branch?

In Stash is there a way to enforce log message only to a select branches, for eg, a particular log format only for master/develop or staging branch?

Nirmal Shankar September 17, 2015

Is there a particular way of enforcing log messages only for a couple of branches in stash (say master or develop). In other feature branches  we don't want to enforce a log message format as of now. Developers are free to create the branches they want (the build will happen only when a merge happens to a branch - say "develop" )

We downloaded the yacc plugin, but I don't see a way to not enforce a commit messages in that depending on branch names

 

2 answers

0 votes
Nirmal Shankar September 17, 2015

Thanks Mark

0 votes
Mark McCormack _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 17, 2015

Nirmal,

There is a paid add-on available in the Atlassian Marketplace called ScriptRunner for Stash which allows you to conditionally enforce a number things including commit messages. There are a number of canned conditions available as examples, or you can write your own using Groovy. These Pre-Receive Hooks can be configured for your whole Stash instance, select projects or repositories. The protect git references pre-receive hook includes example conditions for both a master branch and a feature branch and much more.

For example, you can enforce trusted commit authors (see how in our documentation), enforce naming conventions or write your own custom pre-receive hook.

I hope it helps.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events