Using Gerrit Code Review
Gerrit Setup for Pure Fusion Maintainers and Developers
Getting Set Up
First off you’ll want to familiarize yourself and generate GPG and SSH keys if you haven’t already. Make sure to follow the instructions and related articles to get the keys added to your GitHub account and your local .gitconfig.
- Next, you’ll want to register or login to https://review.purefusionos.com
- Once logged in, go to https://review.purefusionos.com/#/settings/contact and hit “Register new e-mail”
- Enter your e-mail address
- Check your e-mail and confirm the registration
- Add your GPG and SSH keys to gerrit if they are not already there
- Open your .gitconfig file with your favorite editor:
(ex. $ nano ~/.gitconfig)
- Copy and paste the following (with your details, excluding password):
[review.review.purefusionos.com] username = yourusername email = firstname.lastname@example.org password = blkjasdlfjasdofi
Generate an http password in gerrit
- Visit https://review.purefusionos.com/#/settings/http-password
- Click generate http password
- Copy it
- Paste in the .gitconfig info we just added under password
- Save and close your editor
Your First Commit
This assumes you already have sources synced up.
- Open a terminal window and cd to your build root
- Change directory to the repo you are editing
- Create a temporary branch just for uploading this specific set of changes (You must do this BEFORE creating any changes, and you must use the repo command)
- $ repo start temp-branch
- Create your change
- Commit your change
- $ git add .
- $ git commit -S
- Enter a commit message in this format:
- [frameworks/base] Changed blahblah blah
- Save the commit
- Upload your change to gerrit
- $ repo upload .
- Hit (y) to confirm upload
Congrats, you’ve uploaded your first patchset to gerrit!
It is highly recommended you read up on gerrit and the repo command, as there are many more advanced variables and uses for it. It’s a confusing and frustrating tool at first, but once you get the hang of it, it’s very useful.
IMPORTANT NOTICE – ALL DEVELOPERS (INCLUDING DEVICE MAINTAINERS):
You MUST NOT EVER send changes directly to GitHub. ALL changes must go through gerrit. If you for some reason need to bypass the gerrit review system (like if you are cherry-picking a LARGE number of commits or are merging or rebasing your entire repo), you can “push” to gerrit rather than using the review system. If you must do this, please follow the instructions in the example below.
Bypassing Review System
$ git remote add gerrit ssh://email@example.com:29418/FusionDevices/android_kernel_htc_msm8996 $ git fetch gerrit $ git push gerrit