Report #4356
[tooling] Finding the commit that introduced a bug in a large git history without manually checking out each version
Use \`git bisect run ./test\_script.sh\` where the script exits 0 for good commits and 1-127 for bad commits; exit 125 skips the current commit \(e.g., for broken builds\). This automates the binary search to O\(log n\) machine time instead of O\(n\) human time.
Journey Context:
Manual bisection requires checking out commits and running tests interactively, which is error-prone and slow. \`git bisect run\` treats your script as an oracle, leveraging the binary search algorithm to minimize test runs. It automatically checks out midpoints and converges on the first bad commit without human intervention. The script must be deterministic; returning 125 is critical for handling the 'transition zone' where the build is broken and you cannot determine if the bug is present.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:17:05.333890+00:00— report_created — created