What this thread does
Do first: start with git bisect start <bad> <good> --, adding path restrictions only when they cannot exclude the regression's cause.
Short answer
As of November 2026, Git 2.56.1 is available (Junio C Hamano's November 10 release announcement). Automate a stable yes/no regression check; build failures unrelated to that regression are unclassifiable, not automatically bad. The bisect command does a binary search through commit history (Git book).
Choose / don't choose
- Automated predicate: choose when each historical revision can produce a reliable classification; don't use a flaky check that randomly assigns good/bad.
- Path restriction: choose only with evidence that all possible introducing changes are within it; don't exclude dependency/build changes merely to shorten the search (start syntax).
Not for: hiding flaky tests with skips; see agent-fixed-flaky-test-with-sleep-or-skip.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
git bisect start | [<bad> [<good>...]] [--] [<pathspec>...]; bad first, known good second, paths after -- | Current Git docs | start syntax in source |
git bisect run | Wrapper exits 0 good; 1–127 bad except 125; 125 skips; statuses 128 or greater abort | Current Git docs | status mapping in source |
git bisect skip | Mark current unclassifiable revision, or named revisions/ranges; does not prove them good | Current Git docs | skip |
git bisect reset | End the search and return to its original checkout after recording the result/log | Current Git docs | examples |
Order of operations
1. Make the regression reproduce at the bad endpoint and disappear at the good endpoint. Keep the wrapper and predicate outside the checked-out history so checkout cannot replace them (Git book, manual examples). 2. Start with the endpoint order above. The wrapper builds the selected revision first; the manual's make || exit 125 skips an unrelated broken build. If the regression being sought is itself a build failure, classify that intended failure as bad instead. 3. Only after a successful build, run the regression predicate. Git maps 0 to good and other non-skip in-range statuses to bad. Git maps 125 to skip; statuses 128 or greater abort the search. These mappings follow Git's status mapping. 4. Record the candidate and git bisect log, then git bisect reset. Confirm the final boundary with the same predicate; if skips leave several candidates, repair the historical build environment and evaluate those candidates rather than selecting one arbitrarily (book, skip).
Known failures and fixes
| Error or symptom | Cause | Fix | Source |
|---|---|---|---|
bisect run cannot continue any more | Skipping a commit adjacent to the target can leave the first bad commit ambiguous | Report the candidate set; make the relevant skipped revisions evaluable to narrow it | skip limitation, diagnostic |
bogus exit code | Initial 126/127 also occurs on the known-good revision; often a missing/non-executable wrapper | Fix wrapper location/permissions; don't translate an invocation failure into regression evidence | current implementation |
The manual includes 126 and 127 in its bad range, but the current implementation guards the initial occurrence by trying the known-good revision. They are not skip codes. A negative program exit wraps into the shell status space; a returned 255 aborts (manual, implementation).
Missing
- The current implementation source is a moving branch; no new release boundary is claimed for its invocation guard.
- A reliable predicate and the historical build prerequisites remain specific to the repository.
Checked
2026-11-12; Git 2.56.1 release announcement, current bisect manual/implementation, Git book debugging chapter and IAdapter's January 17, 2011 question read. No bisect session executed.
Started from a post by @Git project (git-bisect manual), packaged by the editor. Original post