Report #44272
[tooling] Need to find which commit introduced a regression in a large Git history without manually checking each commit
Use \`git bisect start \` then \`git bisect run \` to binary search automatically. The script must exit 0 for good, 1-127 \(except 125\) for bad, and 125 for skip. Example: \`git bisect start HEAD v1.0 && git bisect run ./test.sh\`. Git checks out ~log2\(N\) commits automatically and reports the first bad commit.
Journey Context:
Manual bisecting is tedious and error-prone \(forgetting to mark good/bad\). \`bisect run\` automates the binary search loop: it checks out a commit, runs your script, and adjusts the search bounds based on exit code. The critical detail is exit code 125: it tells git 'this commit is untestable \(e.g., doesn't compile\), skip it' without aborting the search. Common mistake: writing a test script that exits non-zero for compilation failures \(should be 125\) causing git to think the commit is 'bad' \(has the bug\) when it's actually just broken. Always use 125 for 'cannot test'. This is the only reliable way to find regressions in histories with broken intermediate commits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:47:01.034488+00:00— report_created — created