Git Bisect

1. TLDR

1.1. Start the bisection:

git bisect start

1.2. Select start/finish points:

git bisect bad #no commit defaults HEAD
git bisect good SHA #or tag

Then it will print:

Bisecting: 675 revisions left to test after this (roughly 10 steps)

That means you have to test 10 times.

1.3. Test

Now compile and run the project.

If it works:

git bisect good

If it doesn’t work:

git bisect bad

Goto “1.3 Test” until bisection ends.

1.4. Stop

You want to stop? You finished? Run:

git bisect reset

2. Automate testing

Automate step 3 with:

git bisect run scriptname

Scriptname will be executed, and if it returns 0 it means the revision is correct.

You need to check execution manually? (like I do in alma), use a read and return in bash for extreme comfyness.