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

こ雲淡風輕ζ 提交于 2019-12-11 14:31:52

问题


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?


回答1:


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)



来源:https://stackoverflow.com/questions/44680993/is-it-possible-to-run-a-pre-receive-style-hooks-in-gerrit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!