In gitolite, how to reject pushes containing incorrect author info

做~自己de王妃 提交于 2019-11-27 06:36:22

问题


I intend to only accept the commits containning correct author information. like Author: Name<xxxx@xxx.org>

in gitolite, is there a way to implement it? BTW, I use V2. Thank you in advance.


回答1:


First, with Gitolite V3, it is called VREF, similar to an EMAIL_CHECK VREF.

You can also use in g2 (Gitolite V2) "virtual ref" (precursors of g3 VREF), including the check author email one: the script is "g2/contrib/VREF/gl-VREF-EMAIL_CHECK".
You would need to adapt that script to your own email control policy.

For a hook running for all repos on all users, a simpler version would be an update hook, but since that version uses the update hook already, you will need to chain your own update hook.
See "hook chaining".

To run your own 'update' hook, just put it in a file called update.secondary and install it as a hook.
Gitolite's update hook will automatically chain to it, taking care to pass it the same 3 arguments the original update hook received from git.



来源:https://stackoverflow.com/questions/15939529/in-gitolite-how-to-reject-pushes-containing-incorrect-author-info

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