Sixteen photos at Pak Harun’s studio, the latest blurred: git bisect halves the album, you mark sharp or blurred, half the suspects go free. How many checks…
Why it matters
When a bug appeared in one of hundreds of commits, bisect finds it in a dozen steps. It is only as good as your test, so knowing how to mark well and using git bisect run with an automatic test saves hours.
The key idea
Bisect = binary search over history
Common mistakes
git bisect gives a nonsense answer Usually the test is flaky or a mark was wrong: one wrong mark throws away the wrong half. Use a sure, automatic test with git bisect run, and git bisect log to see your marks.
Bisect points at the wrong commit though the marks were right Bisect assumes a bug, once in, stays in. If the bug comes, goes and comes back, it may stop at another appearance. Narrow the range with a good and a bad you are sure of.
The middle commit will not buildgit bisect skip passes it over, and bisect picks another one nearby. In git bisect run, a test exiting with code 125 means "skip".
Try it in this playground
Mark a print bisect brings yourself Sharp good, blurred bad: half the suspects fade.
Until bisect accuses one photo "is the first bad commit": the culprit is found.
Let bisect run markcek.sh exits 0 for sharp, 1 for blurred.