简体   繁体   English

是否可以在Gerrit中运行预接收样式挂钩?

[英]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? 是否可以在Gerrit中运行预接收样式挂钩,以便在创建补丁之前在其中运行这些策略?

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. 是的,Gerrit通过hooks插件包含了自己的钩子机制,因此,如果某些策略无效,则可以阻止推送。

Consider also to use the Git::Hooks . 还考虑使用Git :: Hooks We use it and it's really good. 我们使用它,真的很好。 Using Git::Hooks you can implement a better strategy to manage these checks: 使用Git :: Hooks,您可以实施更好的策略来管理以下检查:

1) Accept the commit (patchset is created) 1)接受提交(已创建补丁集)

2) Execute the policy checks 2)执行政策检查

3) Vote in the review (approving or blocking the change) 3)在评论中投票(批准或阻止更改)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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