Development/gerrit/PatchReview

From The Document Foundation Wiki
Jump to: navigation, search

Reviewing patches with gerrit

After you completed the gerrit setup, and you or others have submitted patches, you can start to review patches on gerrit.

Finding patches waiting for review

  • ./logerrit query status:open
    
    will show you all patches waiting for review. see gerrit documentation for all the fancy things you can do in addition (for scripting etc.).

Getting a patch

  • ./logerrit cherry-pick CHANGEID
    
    with CHANGEID being the Change-Id shown by the output of the gerrit query

Updating patch

If you found and fixed a problem during review. You might update the existing patch in gerrit the following way:

  • git status; git diff
    
    which makes sure that you have only the single cherry-picked commit and the extra changes on top
  • git commit -a --amend
    
    which updates the last commit locally
  • ./logerrit submit
    
    which pushes all uncommited changes into gerrit; it updates the existing patch in gerrit if the ID stayed the same in the commit message

Comment and Approve

If you want to add comments or approve the patch, the best way is to do it from the Gerrit web interface. Comment by clicking a line of a changed file and when you are done click the Reply... link to publish your review.

Alternatively, you might just push the patch but it will not add the nice comments about reviewing.