Version 9, last updated by Andy Singleton at December 21, 2011 14:25 UTC

Finding Gerrit

You can go to the Gerrit application by selecting "Patch request" on the Gerrit tool, or by clicking on Gerrit events.  In Gerrit, you will a list of patch requests for yourself, and your team.  This page explains how to use git to work with branches and patches in the Gerrit server.

A project owner can create the new repository by pushing from a local repository, and can push directly to it. For technical reasons, before you make the first push, GO HERE to tell the Gerrit server about your account - http://review.assembla.com

Team members with Edit permissions can submit patches and vote.

Developers

Setup

Add new remote url to your local working copy of git repository, replace username with your own.

git remote add review ssh://username@rgit.assembla.com/SPACE_URL_NAME.git

Install commit hook to your local branch repository. Download commit-msg file and copy it to breakout_dir/.git/hooks/commit-msg file.
Change permissions to make it executable: chmod +x WORKING_DIR/.git/hooks/commit-msg

Workflow

New change

Fetch remote master and reset master branch.

git fetch review
git checkout master
git reset --hard review/master

Make some logical changes and commit.
Push your changes for other developers to review:

git push review HEAD:refs/for/master

Other developers will review and accept your change.

Update change

If you want to make some changes after other developers code review, fetch last patchset from gerrit, assuming that you have current branch master.

git fetch && git reset --hard review/master
git fetch ssh://your-username@rgit.assembla.com/SPACE_URL_NAME.git/site/SPACE_URL_NAME refs/changes/17/17/1 && git cherry-pick FETCH_HEAD

Make changes, then commit and push for review again

git commit -a --amend
git push review HEAD:refs/for/master

You also can commit using git gui tool, select Amend check

Rebase with master in case of conflicts

This method should be used only when you used checkout method from gerrit and you have dependent changes.

git fetch review
git fetch ssh://username@rgit.assembla.com/SPACE_URL_NAME.git/site/SPACE_URL_NAME refs/changes/17/17/1 && git checkout FETCH_HEAD
git checkout -b work_branch
git rebase review/master

Fix conflicts, commit and push

git push review HEAD:refs/for/master

SUBMIT (Owners)

In this beta implementation, the permission groups and voting workflow is fixed:

Team members with "Edit" permission can add patches, amend, review, and vote.

Owners with "All" permisison can submit patches to the target branch.  After a patch has +2 votes, the Owner will see a "Submit patch set" button.  Selecting this button will submit the patch to the target branch.

FAQ

What Verified and Code review means:

  • Verified = +1 Verified – code pass requirements, this should close Assembla ticket if change is submitted to master.
  • Verified = -1 Fails – code does not pass requirements, this should set ticket from test to new.
  • Code Review = -2: do not submit: Veto from administrators that code should be rejected.
  • Code Review = -1: vote for changes to be rejected
  • Code Review = +1: vote for changes to be accepted, but someone else should approve, coder are not sure.
  • Code Review = +2: vote for code to be submitted, it looks good and it’s approved.