简体   繁体   中英

Is it possible to run a pre-receive style hooks in Gerrit?

We are planning to have some policies that will ensure we don't accept commits that won't adhere to commit message policy. This policy is specific to a repo.

Is it possible to run pre-receive style hooks in Gerrit where we can run these policies before the patch gets created?

Yes, Gerrit has its own hook mechanism included via the hooks plugin so it's possible to block the push if some policy is not valid.

Consider also to use the Git::Hooks . We use it and it's really good. Using Git::Hooks you can implement a better strategy to manage these checks:

1) Accept the commit (patchset is created)

2) Execute the policy checks

3) Vote in the review (approving or blocking the change)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM