When multiple developers contribute to a project, keeping on top of the constant flow changes can be a challenge. The following simple review workflow assumes a shared git-repository with a fairly linear commit-history, that is, not having too many merge-commits.
So, assuming a fairly linear history of commits from multiple developers, how do you easily keep track of what you have already read through and reviewed? Easy, use a local branch as a bookmark. This tiny script makes it trivial to add or update such a branch:
Save this as a new file called
reviewed.sh in your
Usage is extremely simple:
Running one of these commands will mark the given treeish as reviewed, and when you look at your commit-history in a visual tool such as
git gui or
reviewed branch visually indicates how far you have gotten. Note how both commit-IDs, branch names, tags, and relative commit-IDs can be used as argument.
You can also utilize this review bookmark from the commandline. The following shows you all commits added to master since your last review:
git log reviewed..master --reverse
You can add a
--patch to that command to see the full diff for each change. Adding
--format=oneline just shows you the commit-IDs and first line of the commit-message.
Once you’ve read all the latest commits on master, simply do a
and you’re done.
Why not use a tag?
I find it convenient to be able to do a push of all tags to the central repository with
git push --tags
and this would share such a private review-tag. As this is my private reminder of how far in the commit-history I have reviewed, sharing it is just confusing to other developers.
Notice: Any commits which are added only to the
reviewed branch are unreferenced when you mark a new treeish as reviewed. Just something to keep in mind.
How do you keep track of the flow of changes?
Hi, I'm Laust Rud Jacobsen, an experienced webapp developer specializing in Ruby-based solutions. You can hire me to build awesome stuff for you. If you have any questions or comments, reach out at @laustrud or privately at firstname.lastname@example.org.
A current and exciting development: I'm in the process of writing
Effective Maintenance: taming messy code (Ruby edition).
Sign up below to receive infrequent updates and valuable insights to help you succeed: