Gerrit

Overview

For Exherbo, the preferred method of making contributions of code or documentation is to put patches on Gerrit, a web interface that allows for discussing and reviewing patches with a history of the process.

This documentation is adapted from a blog post by Wulf C. Krueger, and was originally posted to his blog.

Initial setup

For registering an account on Gerrit, you must have a GitHub or Google account; if you register with GitHub, the email address you wish to use in Gerrit will have to be configured in your GitHub account as “public email”.

  1. Go to Gerrit, and in the upper right corner, click “Sign in”.
  2. Authorize with GitHub or Google.

Cloning repositories

  1. Click “Projects”, “List”, then choose a project.

  2. You should see several methods for cloning the project, the easiest way is to choose the ssh method.

  3. Clone, e.g. git clone ssh://<user name>@galileo.mailstation.de:29418/<repository>

  4. Install a hook that sets a Change-Id automatically:

    # Both scp and curl retrieve the same file, pick what you want to use
    $ scp -p -P 29418 <your username>@galileo.mailstation.de:hooks/commit-msg <local path to your repository>/.git/hooks/
    $ curl -o <local path to your repository>/.git/hooks/commit-msg https://galileo.mailstation.de/gerrit/tools/hooks/commit-msg
    
    # Make the hook executable so that git uses it
    $ chmod +x <local path to your repository>/.git/hooks/commit-msg

Submitting patches

  1. Work on your copy of the repository, commit.
  2. Push your changes: git push origin HEAD:refs/for/master

You can find more details on submitting patches at Gerrit’s documentation on uploading patches.

Alternative interfaces

There’s other ways to interact with Gerrit than just the web interface.

Both of these interfaces allow cloning from the git repositories on Exherbo’s git, GitHub, or wherever the repository is located and using the .gitreview file within the repostiory’s root, automatically configuring git to use the Gerrit repo for it.


Copyright 2013 Wulf C. Krueger

Copyright 2016 Kylie McClain