In gitolite, how to reject pushes containing incor

2019-01-19 08:44发布

问题:

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.



标签: git gitolite