Hi all,
Marcus and I have been discussing code review options on IRC and
private email, and the gerrit code review system looks promising. It’s
made for git, and should be good for what we need:
http://code.google.com/p/gerrit/
Here’s a video that has a bit of background on the project:
And a rather detailed overview (with screenshots):
http://unethicalblogger.com/posts/2009/12/code_review_gerrit_mostly_visual_guide
To summarize how it works, I’ll paraphrase from the third link:
Developers set up gerrit as a remote git repository, and to submit
changes for review, just push the to remote, e.g.
#set up the gerrit repo
git remote add gerrit ssh://gerrithost/project.git
Create a topic branch
git checkout -b topic-branch
do work and make commits
Push to gerrit server
git push gerrit HEAD:refs/for/master
Now the gerrit web interface will show that there is a new patch ready
for review, and can optionally send emails to the project
“integrators” who can review and approve the code. There are
side-by-side and unified diffs available on the web interface.
If there is a problem with the commit, the reviewer can discuss it
within gerrit or via email, and an iterative process occurs until the
commit is approvable.
Once the changes are approved, the integrator can push the changes to
gerrit/master to show them as accepted:
banana% git merge topic-branch
banana% git push origin master
banana% git push gerrit master
This automatically closes the submission on the web interface.
It has some features similar to what we’re used to on github:
“Gerrit contains a number of nice subtle features, like
double-clicking a line inside the side-by-side diff to add a comment
to that line specifically, the ability to “star” changes (similar to
bookmarking) and a too many others to go into detail in this post.”
From the screenshots and description, I think this would clear up a
lot of the confusion and problems with our current review process. It
also looks like gerrit does a lot of work behind the scenes from this
flowchart:
http://source.android.com/source/life-of-a-patch.html
Thoughts?