side-shed-notes

small posts about small things

why I stopped bisecting before reading the diff

For about a year my reflex on a regression was: git bisect start, write the test, walk away. The bisect would land me on a commit. The commit would be obvious. I'd go "of course", fix it, and feel clever about the bisect.

Then I started keeping a small note of how often the bisect actually told me something I would not have spotted reading the diff between known-good and current. The number turned out to be a lot lower than I thought.

Now I do this instead, and only fall back to bisect if the change-set really is too big to read:

git log --oneline LAST_GOOD..HEAD -- path/to/suspect/area
git diff LAST_GOOD..HEAD -- path/to/suspect/area | less

If the answer isn't in the first screenful of that diff, fine, bisect. But it almost always is.

This is not a clever insight. It's the kind of thing the graybeard at the next desk would have told me in 2008 if I'd had one. Writing it down here so I'll remember the next time.