blob: 9c34b2abde78a4a6db10f674f0c6083e419b08da (plain
title: Git bisect automation
date: 2020-11-12 2
It is good to have an standardized way to run builds and tests on the repository
of a project, so that you can find when a bug was introduced by using
`git bisect run`.
I've already been in the situation when a bug was introduced and I didn't know
how it even was occurring, and running Git bisect over hundreds of commits to
pinpoint the failing commit was very empowering:
$ git bisect start HEAD $GOOD_COMMIT_SHA
$ git bisect run sn -c './build.sh && ./run-failing-case.sh'
Git will than do a binary search between the commits, and run the commands you
provide it with to find the failing commit.
Instead of being afraid of doing a bisect, you should instead leverage it, and
make Git help you dig through the history of the repository to find the bad code.