How to fix a bug
Yesterday I added a bug to Rhino Service Bus. It was a nasty one, and a slippery one. It relates to threading nastiness with MSMQ, and the details aren’t really interesting.
What is interesting is how I fixed it. You can see the commit log here:
At some point, it became quite clear that trying to fix the bug isn’t going to work. I reset the repository back to before I introduced that bug (gotta love source control!) and started reintroducing my change in a very controlled manner.
I am back with the same functionality that I had before I reset the code base, and with no bug. Total time to do this was about 40 minutes or so. I spent quite a bit longer than that just trying to fix up that.
Lesson learned, remember to cut your losses early :-)
Comments
Looks like a good time to wish you had git bisect ;)
@Aaron: why? Looks like it was easy enough to do a reverse merge in subversion. I don't see what Git offers here.
@Bruce: git bisect does a binary search to help find the exact revision that caused the bug. There's a similar command for SVN written in perl.
Comment preview