Installation of the mirror hooks
On the Gerrit server
- Transfer the
/opt/perforce/git-connector/bin/gconn-change-merged.py
file from the Git Connector into thehooks
subdirectory of your Gerrit installation. - Rename the file in the
hooks
directory tochanged-merged
:mv gconn-change-merged.py changed-merged
The hook
changed-merged
enables the default Gerrit behavior of a mandatory code review of a repo before merging it into a protected branch.TipIf your organization allows direct ref commits without a mandatory code review, make a second copy in the
hooks
subdirectory, this time withref-update
as the name:cp changed-merged ref-update
The name
ref-update
enables direct ref commits. -
Make
changed-merged
(and, optionally,ref-update
) executable by the OS user running Gerrit.