I'm adding a gitolite update hook as a VREF and was wondering if there was a way to apply it to all of the repositories except for the gitolite-admin one.
Having a simpler way rather than listing all of the repositories I want to apply the hook on would be great.
Currently I have:
repo @all
- VREF/update = @all
I was thinking of adding an exception above that one for the gitolite-admin repository. Something like:
repo gitolite-admin
RW+ VREF/update = @all
repo @all
- VREF/update = @all
Is there a way to get a rule like this to work? Thanks for the help! (I tried this way and it didn't seem to work)
Just for other readers less familiar with
VREF
(introduced with "g3" or Gitolite V3).The idea behind VREF rules are:
This is why one can define an '
update
' hook even though theupdate
hook is reserved by gitolite.A normal
update
hook expects 3 arguments (ref, old SHA, new SHA).Any VREF will get those three, followed by at least 4 more. Your '
update
' VREF should just ignore the extra args.Considering the
update
VREF program, you could add a parameter which would allow your update script to recognize it is called in thegitolite-admin
context (and should do nothing):