Report #15726
[tooling] Locating the exact commit that introduced a regression in a large Git history
Use \`git bisect start\`, mark bad/current HEAD as \`git bisect bad\`, mark last known good as \`git bisect good \`, then automate with \`git bisect run ./test\_script.sh\` where the script exits 0 for good and non-zero for bad.
Journey Context:
Developers often manually checkout commits or use \`git log\` to guess where bugs started. \`git bisect\` performs a binary search \(O\(log n\)\), and \`git bisect run\` automates the testing loop—critical for large histories. Common mistakes: the test script must return specific codes: 0 \(good\), 1-124 \(bad\), 125 \(skip/current commit cannot be tested\), 126-127 \(abort\). Not realizing that \`git bisect\` can skip merge commits or use \`--first-parent\` to follow only the mainline history. Also, \`git bisect reset\` is necessary to clean up after finding the commit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:50:54.718343+00:00— report_created — created