~adeodato/ blog/ bzr/ Yay, bzr gives me enough rope to hang myself

Yay, bzr gives me enough rope to hang myself

I definitely like being given enough rope to hang myself. Life wouldn’t be fun without the challenge of trying to hang myself increasingly less often over the years. And Bazaar-NG has shown me today some of the good rope it can give, and I’m happy.

This is about the annoyance that is, at least for me, having to type bzr diff -r 12344..12345 to get the diff introduced in revision 12345, instead of just bzr diff -r 12345 or similar. This happens on other VCSs, like CVS, Subversion, and Bazaar (or so I hear).

For Subversion (as an anecdote), five months ago (January) I found out on IRC (thanks, peterS) that a -c <revno> option had been added to svn diff which did precisely that (commited 3 months before, in October). An improvment that would be released in version 1.4, due in about a month or so now (but six when I first heard about it, and nine after being implemented).

For Bazaar-NG, it’s been today the day I’ve got annoyed enough by this issue (while peeking here, btw) as to search if there had been any discussion on this issue, and I found this six-month old bug. It seemed a bit dead, so I gave my opinion about the issue, and discussion seems to have started again.

The good part comes now, though. I’m sure the bzr developers will give a solution to this problem: maybe sooner, maybe later; maybe the one I liked most, maybe not. But, the important thing for me is that I have, within hours of having felt frustrated, a solution that works for me: a plugin that wraps the diff command and interprets “-r N” the way I want. It may make the bzr authors shake their head (or not :P), but I certainly feel grateful for them having given me the possibility of doing it, and of being my responsibility whether to continue to use it in the future.

Oh, you can find the crack here. Surprisingly compact. (Update: well, not that much anymore after reimplementing it in a non-dumb way.)

NP: Paolo Conte, Via con me