Using Gerrit Code Review

Using Gerrit Code Review

You are here:
< Back

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.

https://help.github.com/articles/generating-a-new-gpg-key/
https://help.github.com/articles/connecting-to-github-with-ssh/

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.

https://review.purefusionos.com/Documentation/user-upload.html#_repo_upload

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://username@review.purefusionos.com:29418/FusionDevices/android_kernel_htc_msm8996
$ git fetch gerrit
$ git push gerrit