Enable/Disable Code Review

Note: This section is for system administrators only.

To enable GitCentric’s optional Gerrit Code Review functionality:

  1. The ACLs required to support code review are configured automatically for all new GitCentric installations; users upgrading to GitCentric 2013.3 may need to configure additional ACLs. As there is no one set of ACLs that is appropriate for every installation, you, as the administrator, should review these settings and adjust them as needed. See Configuring ACLs for Code Review for more information.
  2. Your users must configure their clones by adding the following line to the [remote "origin"] section of each clone’s config file:
    push = refs/heads/*:refs/for/*

    This specifies the source refs/heads/* and target refs/for/* branch mapping that will be used to push changes to a special branch for code review. Users can add this line by executing the following command on each clone:

    git config remote.origin.push 'refs/heads/*:refs/for/*'
  3. Copy the commit-msg hook to the .git/hooks/ directory of each clone. For example:
    scp -p -P <port><server>:hooks/commit-msg .git/hooks/

    where:

    <port> is the SSHD listener port (typically 29418).

    <server> the host where GitCentric is installed

If you forget to copy the commit-msg hook, your push will fail. The error message you receive in this situation instructs you to copy the commit-msg hook, as described in Step 3 above. You must then execute a

git commit --amend

before trying the push again.