Reputation: 13
Installed Gerrit (version 2.13.1) by following the steps in the following link:
https://gerrit-review.googlesource.com/Documentation/install-quick.html
in Ubuntu 16.04 environment.
Created a hooks folder in '$site_path'/hooks and added a ref-update hook file which just exits with return code 1.
Provided executable permissions to this file.
After Gerrit server restart, it is allowing me to do a push operation.
Upvotes: 1
Views: 2064
Reputation: 21
I'm using Gerrit 2.14. This works for me:
Behavior change in ref-update hook
Instead of being invoked on every commit received, the ref-update hook is now invoked before the ref update operation is finalized. The previous behavior of the ref-update hook is moved into a new hook named commit-received.
Sites using the ref-update hook should rename the hook file to commit-received.
https://www.gerritcodereview.com/releases/2.14.md#Behavior-change-in-ref_update-hook
Upvotes: 2
Reputation: 31
You can also add hooks manually:
chmod +x ref-update
This you need add to your gerrit.config file:
[hooks]
path = /hooks
In generally way:
[hooks]
path = /path/to/yours/hooks/folder/hooks
Upvotes: 0
Reputation: 22361
Since Gerrit 2.13 you have to install the hooks plugin.
See more details at Gerrit 2.13 Release Notes and Gerrit Documentation.
The hooks plugin is a core plugin, it is packaged within the Gerrit war file and can be installed executing:
java -jar gerrit.war init -d <site_path> --install-plugin=hooks
More info here.
Upvotes: 2