Code Reviews with Kaleidoscope

| By Doug Russell

In Kaleidoscope 2 we have made version control integration even better and easier to use. We would like to show you one of the many ways you can take advantage of this in Git with a simple but wonderful alias we call ksreview.

KSReview is a useful way to do code reviews of feature branches. KSReview compares all of the work done on a feature branch since it diverged from master (or from another branch you specify) while filtering out any other activity from that branch that might otherwise get in your way. We use this ourselves every day and we think it is a fantastic way to do code reviews. Take a look:

Installing KSReview

To install ksreview from the command line, just enter the following:

git config --global alias.ksreview '!f() { local SHA=${1:-HEAD}; local BRANCH=${2:-master}; if [ $SHA == $BRANCH ]; then SHA=HEAD; fi; git difftool -y -t Kaleidoscope $BRANCH...$SHA; }; f'

Using KSReview

To use ksreview while you're on the feature branch, assuming your mainline branch is master, just enter the following at the command line:

git ksreview

If you're on a different branch or your mainline isn't master, you can be more specific:

git ksreview feature-branch-name-or-sha mainline-branch-name

We hope you enjoy using ksreview!

UPDATE:

Kevin Ballard was kind enough to lend us some of his bash know how so we've updated our instructions for installing ksreview above. If you installed the earlier version you're fine to keep using it, but if you'd like to update, just follow the install instructions above.