2021-02-02

git bisect succinctly

I can never remember how to git bisect , it's occasionally super-useful and there are extensive posts about it elsewhere, but I've never needed more than:

cd ../top-of-repo

#                sad  happy
git bisect start HEAD HEAD~200 --

# run the test you wrote
git bisect run sh -c 'cd somewhere; pytest something'

# tests run
# then you see like:
# abcd123... is the first bad commit
# then to clean up
git bisect reset