Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
613 views
in Technique[技术] by (71.8m points)

git - In gitolite, how to reject pushes containing incorrect author info

I intend to only accept the commits containning correct author information. like Author: Name<[email protected]>

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...