Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system. PandaGerrit is using gerrit with github authentication.

LogIn to panda gerrit for the first time
  1. ) Open in a webbrower.
  2. ) Fill in your 'Full Name' and then click 'Save Changes'
  3. ) In, click 'Generate Password'.
  4. ) In, click 'GitHub', then click 'Repositories' to import repositories from github to gerrit. Follow the steps in gerrit to import repos.

configure gerrit
  1. ) In, click 'Projects' -> 'List', select a project to start.
  2. ) Under the project, you will find a line starting with 'git clone', copy it. If you have some ssl errors, add 'GIT_SSL_NO_VERIFY=false'
             GIT_SSL_NO_VERIFY=false git clone
  3. ) go to your local clone directory. follow this example to update your .git/config. The 'password' is generated from ''.
             [wguan@lxplus0234 testcore]$ cat .git/config 
                     repositoryformatversion = 0
                     filemode = true
                     bare = false
                     logallrefupdates = true
                     sslVerify = false
             [remote "origin"]
                     fetch = +refs/heads/*:refs/remotes/origin/*
                     url =
             [branch "master"]
                     remote = origin
                     merge = refs/heads/master
             [wguan@lxplus0234 testcore]$ 
  4. ) add these tools to your project
  5. ) run this command below which is download from tools ./tools/

Development using gerrit
  1. ) refresh to the latest master/main-dev branch
  2. ) create a new local branch: It's not good to work on the master or main-dev branch. Because some others may update these branches.
  3. ) develop your code
  4. ) add your code
  5. ) commit your code
  6. ) submit review
        git checkout master
        git fetch; git pull
        git checkout -b localdev
        vi mycode
        git add mycode
        git commit -a -m 'desc of my code'

Fix conflicts
If you get an error message from gerrit like “Please merge (or rebase) the change locally and upload the resolution for review.”, then that means that someone got a change approved for a file while you were working on the same file. This means that you need to fix your commit:
  1. ) Make sure you are working on the master branch.
        git checkout master or main-dev
  2. ) Get the newest changesets from origin/master:
        git fetch; git pull
  3. ) Switch to your feature branch and merge in the changes:
        git checkout your-branch
        git rebase master
  4. ) This will break at some point at the problematic file(s). Edit them and mark them as resolved:
        git diff
        emacs file1
        emacs file2
        git add file1
        git add file2
  5. ) Finish the merge:
        git rebase --continue
  6. ) Submit for review:
       git commit --amend

Review the codes
  1. ) From, click 'All' --> 'Open'. You will find all open patches. Click the one you want to review.
  2. ) Click to open the updated file, you can click the line number to comment. you can also select par the code to comment. (These comment are draft and will not publish until you click reply). gerrit-comment-code.png
  3. ) go back to patch review page. Click 'Reply...', you can put the score here. score '2' means 'can be approved'. gerrit-reply.png

-- WenGuan - 2015-04-27

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng gerrit-comment-code.png r1 manage 32.9 K 2015-04-27 - 18:57 WenGuan  
PNGpng gerrit-reply.png r1 manage 57.5 K 2015-04-27 - 18:57 WenGuan  
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2015-04-27 - WenGuan
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    PanDA All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback