Lately, I've been neck-deep investigating a number of bugs.
Sometimes it's behaviour that has never worked, in which case it can be challenging to find exactly what is causing the problem.
Other times, there's a change in behaviour and something that used to work, stops working. In this case,
git bisect is the tool for the job.
It allows you to track down the specific commit that resulted in the behaviour changing by automating the process of narrowing down the currently investigated commit. So long as you have a known good state, and a current bad state, this will find the culprit.
It can be a bit fiddly to get the the minimal set of reproduction steps needed to do this efficiently, particularly if the known good state is quite some time ago, but it's well worth it.
Today I spent about ten minutes in this process and once it found the culprit, it was a relatively easy fix in the end. But I would never, ever have suspected that line of code otherwise.
[Image credit: J Mark Dodds]