Skip to content

Instantly share code, notes, and snippets.

View natesire's full-sized avatar
🏠
Working on a Chat Bot

Nate Sire natesire

🏠
Working on a Chat Bot
View GitHub Profile
@natesire
natesire / gist:ed95e6079f466941d52ffdc1213ccda2
Last active June 20, 2021 19:10
Find Memory Leak or Bug with Git Bisect
git bisect start
git bisect bad
git bisect good commithashxxxxx
Git bisect will use the divide and conquer (binary search) strategy to speed up finding where a bug was introduced into the code.
IMPORTANT NOTE! It’s easy to mix up GOOD and BAD.
I realized that one of my unit/integration tests was faulty. My authentication system was redirecting to the wrong URL. However, this had been going on for a while. Users had been clicking the homepage icon to work around the problem. I needed a fast way to find when the bug was introduced. So I asked on the Python Slack group even though this happened on my Rails stack. XXXXX gave me this excellent solution. XXXX said that the solution came to him from reading the Pro Git book cover to cover.