🔀 Git: Fix a Bisect Session Stuck Skipping the Same Commit Forever
git bisect skip is meant for the occasional untestable commit, but if an entire sub-range of the remaining candidates is untestable — because an unrelated infrastructure break, not the bug you’re actually hunting, affected every commit in that window — the bisect algorithm’s binary search has nothing left to narrow on: every point it picks inside that polluted range gets skipped too, so it keeps proposing commits from the same unresolved window without ever converging, which looks exactly like being stuck on one commit even though it’s technically still searching.
🔎 The Problem
$ git bisect skip Bisecting: 12 revisions left to test (roughly 4 steps) [abc1234] Some commit in the broken infra window $ git bisect skip Bisecting: 12 revisions left to test (roughly 4 steps) [def5678] Another commit in the SAME broken window # ...repeats indefinitely - the whole remaining range between # the last known-good and known-bad commit is affected by an # unrelated CI/build break, so skip gives the algorithm zero # information to narrow on
✅ Fix: Find and Exclude the Broken Sub-Range Deliberately
- Run
git bisect visualize(orgit bisect log) to see the actual remaining candidate range, rather than continuing to skip blind — if that whole window shares an unrelated breakage, no amount of further skipping will let the search converge. - Identify the commit where the unrelated infra/build break was introduced and fixed, and either test against a patched environment for that window, or restart the bisect with explicit
good/badbounds that exclude the polluted range entirely. - Treat repeatedly landing on the same handful of commits after several skips as a signal to stop and inspect the range, not as a reason to keep skipping — that pattern specifically means the remaining window has run out of testable information, not that you haven’t skipped enough yet.
🚨 Why This Is Dangerous
- Abandoning a bisect session as unreliable and reverting to manually checking out commits one at a time, when the actual fix was recognizing that a whole sub-range shared one unrelated break — a few minutes identifying that range would have let the same bisect session converge normally.
A bisect that keeps skipping isn’t broken — it’s telling you the range it’s searching has run out of information.

