Report #39155
[tooling] Manually binary searching through git history to find regressions is time-consuming
Use \`git bisect start\`, \`git bisect bad HEAD\`, \`git bisect good v1.0\`, then \`git bisect run ./test\_script.sh\` where the script exits 0 for good, 125 for skip, and 1-127 for bad. Git automatically checks out commits and runs the script until it isolates the first bad commit.
Journey Context:
When a regression is discovered, developers often manually checkout old commits, build, test, and repeat to find the breaking change. This is slow and the search space is logarithmic if done correctly, but manual process invites human error \(forgetting to rebuild, skipping commits, incorrect good/bad marking\). \`git bisect\` automates the binary search algorithm. The \`run\` subcommand automates the testing: it checks out a commit, runs the provided command, marks the commit good or bad based on the exit code \(0 = good, 125 = skip/untestable, 1-127 = bad\), and repeats until the first bad commit is isolated. This can run unattended and finds the exact commit in log2\(N\) steps. Common mistake: using \`git bisect\` manually \(typing good/bad at each step\) when a test script exists, or not ensuring the test script returns correct exit codes \(especially 125 for 'skip' when the commit cannot be tested due to unrelated breakage\). Tradeoff: requires a reproducible test case that can be scripted and returns reliable exit codes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:11:35.446006+00:00— report_created — created