是否可以在Gerrit中运行预接收样式挂钩? [英] Is it possible to run a pre-receive style hooks in Gerrit?

查看:80
本文介绍了是否可以在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.

是否可以在Gerrit中运行预接收样式挂钩,以便在创建补丁之前在其中运行这些策略?

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.

还请考虑使用 Git ::钩子.我们使用它,它真的很好.使用Git :: Hooks,您可以实施更好的策略来管理这些检查:

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)接受提交(已创建补丁集)

1) Accept the commit (patchset is created)

2)执行策略检查

3)在评论中投票(批准或阻止更改)

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

这篇关于是否可以在Gerrit中运行预接收样式挂钩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆