This is a tutorial how to use Gerrit for Haiku development. It includes explanations.
Gerrit is a free, web-based team code collaboration tool. It integrates closely with Git, a distributed version control system.
This tutorial explains how to:
- set up Gerrit access (for code review)
- submit a patch (changeset) for review
Once you have cloned the repository, with Git, you have the complete copy of the source code that is ready to build into a live ISO or a raw disk image as explained here. The ISO/raw image generated can be used to install Haiku on your machine.
Once you have configured Git in your system, as explained here, it’s ready to set up SSH keys in Gerrit.
Set up SSH keys in Gerrit
Haiku uses SSH keys to establish a secure connection between your computer and Gerrit. Setting them up is fairly easy, but does involve a number of steps.
If you have already set up ssh on your system you can proceed, you don’t need to generate new keys. To make sure whether you need to generate a new key, you need to check if one already exists. List the files in your .ssh directory (if you have one):
If you see id_rsa.pub file you can proceed to #Add your SSH key
Generate a new SSH key
Run the command to generate a new key. It will prompt to enter a passphrase.
ssh-keygen -t rsa -C "firstname.lastname@example.org"
It will create 2 files in ~/.ssh
~/.ssh/id_rsa: identification (private) key
~/.ssh/id_rsa.pub: public key
Add your SSH key
The id_rsa.pub is the public keys file which contains the public key.
- Create an account at review.haiku-os.org if you do not yet have one.
- Click on your username in the top right corner, then choose “Settings”.
- Click “SSH Public keys” in the menu on the left.
- Paste your SSH Public Key into the corresponding field and click “Add”.
Once you have added the SSH key, you can make sure that you have configured everything correctly using:
The above command should display a welcome message and then abort. Example:
If you are able to see the welcome, you are good to submit a patch-set to Gerrit!
How to submit a patch?