Report #104537
[tooling] How to automatically find the commit that introduced a bug using binary search without manual testing?
Write a test script that exits 0 for good, 1 for bad, and run \`git bisect run ./test.sh\` to automatically bisect. For example, to find a regression in a web app: \`git bisect start HEAD ; git bisect run ./run-tests.sh\`. The script should be idempotent and fast.
Journey Context:
Many developers know \`git bisect\` but manually type \`git bisect good/bad\` at each step. That's slow and error-prone. \`git bisect run\` automates the entire process. The test script must handle unexpected states \(e.g., build failures\) by returning a non-zero exit code. Common pitfalls: using \`\+\` in the script's return code \(e.g., \`exit 125\` to skip a commit\). The tradeoff: you need a reliable, fast test; if tests take long, bisect may still be slow. But it's vastly more efficient than manual bisect. This is a standard git feature, not a plugin.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-06T20:02:57.799923+00:00— report_created — created