[darcs-users] code review tips

Simon Michael simon at joyful.com
Tue Aug 31 21:03:10 UTC 2010


Hey all,

I don't review darcs patches often and found it a bit offputting. Here are some tips for myself which might help others 
or stimulate better suggestions:

Set yourself a time limit, with an alarm. Don't be afraid to send a partial review. I assume they get easier and faster 
with practice.

Read the whole thread before diving into detailed review. Someone might already have done the work, or there may be 
newer versions of the patch.

I used first mozilla thunderbird pointed to the gmane.comp.version-control.darcs.user newsgroup, and second the patch 
page in the issue tracker, which is http://bugs.darcs.net/patchNNN . The latter should be the best single place to see 
all status, if you trust that mail to tracker mirroring is reliable. I notice at least some time lag.

The standard review format is a reply to the same thread, quoting some or all of the patch bundle, interleaved with your 
comments. The original message might have the patch inlined or attached; the latter probably won't be included when you 
reply. I think they're always available as downloads from the tracker page; I downloaded the latest from there.

On my system they saved as .dpatch files, which I loaded into emacs for a first read. In ~/.emacs I have (add-to-list 
'auto-mode-alist '("\\.dpatch$" . diff-mode)), which dims all the context lines and makes it easier to pick out the 
actual changes. I also did M-x highlight-lines-matching-regexp, hunk, hi-yellow, which makes the hunk lines and 
filenames stand out. And of course I stripped off the final Context section, which you don't need in the review.

When a patch bundle contains many/large patches, maybe split them up so you can review just one or more at a time 
without getting overwhelmed. Search for left bracket at the beginning of a line (in emacs, C-M-s ^\[ ). If you do this 
make it clear in your message which patches the review covers.

After reading, I copied one or two patches and used thunderbird's Paste As Quotation feature, then trimmed and inserted 
my comments. I saved often to the drafts folder to avoid demotivating data loss. I probably could have also done all 
editing in emacs, adding quote marks with M-x regexp-replace, ^, > .

If someone finds this worth rehoming on the wiki, please go ahead. Other tips welcome.

-Simon



More information about the darcs-users mailing list