Versioning saves the day again

Mon, 19 Dec 2011 14:43:21 -0600
LessonsLearned, PHP, Programming, VersionControl, git

I use GIT for versioning projects I'm working on. I was able to use it to find a tricky bug today by hopping through commits.

It's pretty much the first time I've done that.

The bug was some PHP code that looks like this:

else
{
    echo somefunction($var); } ?>
}
<?php

I looked at the HTML where the } were showing up, which was way at the top. (The jQuery DataTable additions pushed it even further away.) Which was way away from where it actually was. I thought it might be in the jQuery but had no luck after turning off a few of the included scripts.

I decided to track it down by hopping through commits, and found it after the second try. It feels good to have tools that help you fix things. Don't code without versioning!