Installation of the mirror hooks

On the Gerrit server

  1. Transfer the /opt/perforce/git-connector/bin/gconn-change-merged.py file from the Git Connector into the hooks subdirectory of your Gerrit installation.
  2. Rename the file in the hooks directory to changed-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.

    Tip

    If your organization allows direct ref commits without a mandatory code review, make a second copy in the hooks subdirectory, this time with ref-update as the name:

    cp changed-merged ref-update

    The name ref-update enables direct ref commits.

  3. Make changed-merged (and, optionally, ref-update) executable by the OS user running Gerrit.