Using git for code review
Contents
At my workplace, I’ve recently been using git for code review purposes. I work on code in my own git clone, and ask a peer to review it. It works somewhat like this:
master
branch is same code as currently in upstream.- Working to resolve issue #1234 pertaining to “Performance for gizmo”, I work
on a branch
1234-gizmo-performance
. - I mail a peer, John, with this information, as well as my repository location.
- John adds my repository as a remote, lutzky. Then he branches
review1
(orreview2
if that is taken, and so on) atlutzky/1234-gizmo-performance.
- John adds comments with nice big
FIXME
tags, which are highlighted in any decent editor. He commits this, the commit-message stating that it was code review. - John tags his final review commit (or, if he had no comments -
lutzky/1234-gizmo-performance
) with areviewed1
(orreviewed2
, etc.) annotated tag. Since the annotated tag includes all the necessary information (who tagged, when, and what), the number doesn’t really matter. - I merge
john/review1
, incorporate the changes (or reject them) and remove the comments. If no further review is necessary, I submit this - and once submitted, I merge this back into master.
It’s a nice system. I wonder what other methods there are of doing this.