Gerrit Code Review for Exherbo
This post is outdated and only kept for historical reasons.
I’ve installed a Gerrit Code Review instance on my server for use with Exherbo.
Gerrit is a code review tool and allows for
- discussing patches and keeping the results for future reference
- get notified by email about changes (if you want)
- easily work on every Exherbo repository
- contributors to get their repositories added to Gerrit as well (optional but strongly recommended)
You’ll find an introduction to Gerrit here.
- You need a GitHub or Google account. The email address you wish to use in Gerrit must be configured in your GitHub account.
- You MUST use your real name for copyright reasons.
- Gerrit replicates merged changes pretty much immediately. This sometimes/rarely fails on the first attempt for various reason. I’ve implemented a fallback that occurs every 5 minutes.
How to use Gerrit:
Initial setup in two easy steps:
- Go to https://galileo.mailstation.de/gerrit//, in the upper right corner, click “Sign in”.
- Authorize Gerrit with GitHub or Google.
Cloning a repository:
- Click “Projects”, “List”, then choose a project.
- You should see several methods for cloning the project, the easiest way is to choose the ssh method.
- Clone, e. g. git clone ssh://<user name>@galileo.mailstation.de:29418/alip
- Install a hook that sets a Change-Id automatically (choose one of the two alternatives):
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
chmod +x <local path to your repository>/.git/hooks/commit-msg
There are several methods to upload changes:
- Work on your copy of the repository, commit.
- Push your changes: git push origin HEAD:refs/for/master
You’ll find more details at https://galileo.mailstation.de/gerrit/Documentation/user-upload.html
You can use git review for easily setting up your repository clone and submitting patches, too. It’s quite nice, use it!
You might want to read the following posts as well:
And if you just can’t get enough: All my posts about Exherbo’s Gerrit.