How can an investigator narrow a reproducible regression through Git history while distinguishing an untestable revision from an observed failing test?
Substantively revised October 23, 2026. Author interpretation, documented cases and hypothetical examples are distinguished below.
A broken test launcher can make healthy revisions look broken. Git can then return a precise commit identifier from invalid observations. The search has narrowed the labels it received; it has not established that those labels described the application's behavior.
Direct answer
Before bisecting, define a reproducible predicate and verify known good and bad endpoints in the intended environment. Preserve the difference between a passing test, a failing test and an untestable revision. Git bisect run uses exit zero for good, a defined range for bad and exit 125 for skip. If a boundary revision is skipped, retain the resulting ambiguity instead of selecting a convenient candidate. The experiment below operates only in disposable invented history and checks actual predicate execution. It identifies a constructed behavior boundary, not a real bug's root cause or an individual's responsibility.
Key takeaways
The quality of the partition depends on the test labels. A search can narrow history efficiently while repeatedly classifying infrastructure failures as application failures. Verify that the intended test actually ran, rather than accepting every nonzero status as evidence about the code under investigation.
Untestable and bad are different observations. Skipping a revision does not establish that it passes or fails. When that missing observation sits at the behavior boundary, a truthful result can be a set of possible commits rather than one definitive identifier.
A first-bad boundary is relative to the chosen predicate and history interval. It is not automatically a causal explanation, a blame judgment or proof that a complex history changes behavior only once. Those stronger conclusions require additional investigation.
Definitions and relationships
A regression predicate is the specific operation used to classify a revision for the investigation. It must capture the behavior being sought well enough that the endpoint labels and intermediate results have a consistent meaning. A working build command alone is not necessarily a test of the reported regression.
A known interval begins with a revision classified good and another classified bad under that predicate. Bisection chooses intermediate candidates and uses their observed classifications to narrow the relevant history. The graph and the labeling assumptions together determine what the narrowed result can mean.
A skipped revision is one the investigation cannot classify with its intended test. A candidate boundary set records uncertainty left by such gaps. Retaining that uncertainty is part of the result rather than a defect to conceal with a more confident sentence.
The problem with a plausible culprit
Imagine a hypothetical investigator who knows a local test passes in an older revision and fails in a newer one. The project contains several intermediate changes. Reading every diff without a controlled predicate risks turning the investigation into a sequence of guesses about changes that look relevant.
Bisection can organize that search, but it cannot manufacture a trustworthy observation. If an intermediate revision cannot run in the environment, the investigator must decide how to record that limitation. Labeling it bad because a process returned an error can place the search boundary at an unrelated setup change.
The useful decision is what the label refers to. Did the application test observe the failure, or did the environment prevent that test from starting? A precise commit identifier is valuable only after those distinctions are preserved through the investigation.
Root cause: process status is detached from its producer
Automation often compresses several operations into one status: launch an interpreter, prepare a build, run a test and classify the revision. If the outer process supplies a failure-shaped status before the actual predicate runs, the classifier may lose the origin of that status.
This is dangerous because bisection is responsive to its observations. It does not need to know whether a label came from a real failed assertion or an unrelated launcher problem. A complete-looking search log can therefore record an invalid sequence consistently.
The repair is to validate the measurement path. Keep the predicate separate from history that will be checked out, test its endpoints and retain enough execution evidence to distinguish a reached predicate from an unavailable environment. Choose skip or abort deliberately where appropriate rather than promoting every failure to a regression observation.
Framework: the Revision Predicate Contract
The Revision Predicate Contract is the author's proposed method for reviewing a bisection investigation. Its components are Behavioral Question, Execution Evidence, Outcome Mapping and Boundary Interpretation. It supports an honest search record rather than promising a universal diagnosis from Git history.
Behavioral Question defines what must pass or fail. The experiment uses a deliberately simple broken flag that becomes true at revision five and remains true afterward. That constructed monotone history makes the expected boundary known in advance; real histories may require a more careful scope and predicate.
Execution Evidence shows that the intended predicate ran against the candidate being classified. The study uses an external execution log alongside direct endpoint checks. These controls are separate from Git's search log because a search log alone can faithfully preserve labels produced by the wrong process.
Outcome Mapping states how the launcher translates observations into good, bad, skipped or aborted search outcomes. Use an explicit mapping for setup failures and untestable revisions. Do not assume a command-not-found status carries the same substantive meaning as a failed application assertion simply because both are nonzero.
Boundary Interpretation states what the narrowed history actually establishes. A successful controlled run can identify the constructed first-bad commit. A skipped boundary can leave multiple candidates. A real causal explanation still requires examining the change and reproducing the relevant behavior beyond its position in the search.
Framework example and application
Create eight invented linear revisions, with the broken flag false in one through four and true in five through eight. Verify the first and last endpoints directly, then run the search with a predicate that records each reached revision and returns its chosen status.
Apply the same contract when the test environment changes across history. If revision five is deliberately untestable, record skip and inspect the remaining candidate set. The loss of a unique answer is useful information about evidence coverage, not permission to relabel that revision after seeing which result would be more convenient.
Three documented mechanisms
Example 1: bisect run has a specific exit-status protocol
Git's bisect manual specifies zero for good, statuses one through one hundred twenty-seven except one hundred twenty-five for bad, and the special one hundred twenty-five status for an untestable revision. Other statuses abort the automated search. The manual also describes ending a session and retaining test scripts outside the changing checkout. [S1]
The practical implication is to inspect the wrapper's status mapping. A launch failure can fall into a bad classification range without having run the intended predicate. The local study therefore checks endpoint execution and retains an independent log rather than treating the search's own status as a complete correctness oracle.
Example 2: revision traversal supplies a partition candidate
Git's rev-list manual documents bisection helpers that choose a commit roughly between included and excluded history. This explains the partitioning mechanism without requiring an investigator to select every intermediate revision by visual inspection. The helper's graph decision remains dependent on the correctness of labels supplied to the search. [S2]
The fixture checks that the helper selects a candidate inside its declared interval. It does not claim a universal number of steps, a measured speedup or suitability for every nonlinear or behavior-reversing history. The source of uncertainty in a predicate is not removed by a well-balanced partition.
Example 3: the worked workflow restores its starting context
The official Pro Git debugging chapter illustrates declaring good and bad revisions, testing intermediate candidates and ending with bisect reset. Its worked sequence documents a practical investigation workflow. The local experiment applies those operations only to newly created fixture repositories and checks their restored state. [S3]
The restoration claim is deliberately bounded. The study does not reset or clean a production checkout and does not recommend destructive recovery commands for a directory containing unrelated work. A disposable fixture allows the mechanism to be examined while retaining the surrounding project state.
Case study: an invented eight-commit history
Python 3.11.9 orchestrated Git 2.51.0.windows.1 in a new verified directory inside the workspace's test area. The experiment created its own repository, empty hook directory and eight linear commits. It used local fixture identity and disabled inherited system and global configuration for its Git calls.
Each commit contained an invented revision number and a broken flag. The flag was false for revisions one through four and true for five through eight. A test script outside the checked-out repository read that file, recorded the reached revision and status in a separate log, and returned the chosen outcome.
Before bisection, the script directly checked that revision eight returned one and revision one returned zero. It then restored the fixture's main branch. These endpoint controls established that the invented predicate and its current interpreter could distinguish the known cases before the search relied on them.
The ordinary run found the constructed boundary
The first search used revision eight as known bad and revision one as known good. Git bisect run invoked the explicit interpreter and external predicate. The resulting first-bad reference and output identified revision five, matching the deliberately constructed transition in the fixture.
The retained search log included its good and bad decisions. The separate predicate log confirmed actual execution and showed that its non-skip outcomes matched the invented broken flag. The result therefore did not depend solely on interpreting a final success-shaped search message.
After bisect reset, the fixture returned to its main branch and original tip. The experiment checked those states rather than assuming a found boundary automatically restored the caller's context. No production branch was checked out or rewritten.
The skipped boundary left two candidates
A separate run used the same invented history but returned status one hundred twenty-five at revision five. Other testable revisions used the same predicate as before. The script did not call the skipped revision good or bad for that run.
Git reported an ambiguous result containing revision five and revision six as possible first-bad commits, and the automated run exited with status two. The search log explicitly retained a skip decision. This outcome was expected evidence of the missing boundary observation, not a failed assertion that the tool should somehow recover a unique answer.
The experiment still knows revision five's constructed flag because it created the fixture. That author knowledge is not substituted for the deliberately unavailable test outcome in the skip run. Preserving the distinction makes the example a genuine examination of what the search can conclude from the observations it actually receives.
A setup failure was rejected as regression evidence
During earlier restricted Windows rehearsals, the MSYS shell could not create a required named object and failed before the predicate ran inside the bisection. The separate predicate log contained endpoint checks but no corresponding search executions. Git nevertheless classified those launcher failures as bad and produced an incorrect boundary.
Those preliminary results were discarded. The accepted experiment ran with the local operating-system access needed for the shell to start, then required actual predicate log entries. The accepted ordinary result identified revision five, while the deliberately skipped result retained its two-candidate ambiguity.
This is observed setup behavior in this rehearsal, not a general claim that Git for Windows misclassifies valid tests. It demonstrates why an error's origin matters. A tool following an exit-status protocol cannot establish that the status came from the application behavior the investigator intended to measure.
Restoration and scope
After the skip run, bisect reset restored the disposable main branch, its worktree was clean and no bisection references remained. The production repository's commit remained unchanged. The fixture directories were retained for inspection; no recursive deletion or production cleanup was performed.
All 21 assertions passed in the accepted run. They covered the constructed history, actual endpoints, partition candidate, ordinary boundary, skipped ambiguity, execution log and restoration checks. They do not establish a real project's root cause, performance characteristics or the correctness of every possible bisection predicate.
Failure example: a launcher error becomes a code verdict
The discarded restricted run is a concrete example of invalid evidence with a precise-looking result. The shell startup failed, the intended predicate was not reached during the search, and intermediate revisions were marked bad. A final commit identifier could have made that mistaken sequence appear more convincing rather than less.
The repair was not to choose a different suspect manually. It was to restore the disposable search, correct the execution environment and verify that the actual predicate produced the statuses. A valid partition requires valid observations; changing the search interval without repairing its measurement path would leave the same underlying defect.
In a real investigation, decide whether a setup failure should abort or mark a candidate untestable. Either can be appropriate under an explicit policy. What is not justified is silently describing an unexecuted application test as an observed application failure.
Common mistakes in regression searches
One mistake is treating an untestable revision as bad to keep the search moving. That can create a sharper answer by inventing information. The skip control shows the honest alternative: retain the unavailable observation and report the candidate set it leaves unresolved.
Another mistake is keeping the test script inside files that the search changes or removes. The fixture stores its predicate outside the checked-out repository. A real investigation should inspect where its test logic comes from so the meaning of pass and fail does not drift unnoticed during history traversal.
A third mistake is assuming a first-bad identifier explains cause. The predicate defines the observed boundary. A change can expose a pre-existing problem or interact with other conditions, so understanding the actual failure still requires examining the behavior and relevant diff.
Finally, do not infer that a complex history has the fixture's single transition. This study intentionally constructs a linear monotone flag. A real symptom can disappear and return, depend on merges or change with the environment. Scope the search and validate the predicate rather than borrowing assumptions from the invented example.
Counterargument: why not inspect the diff directly?
For a tiny interval or an obvious reproducible change, direct diff inspection can be sufficient and easier to explain. Bisection is not a requirement for every defect. The useful choice depends on whether a reliable predicate can reduce uncertainty more effectively than reading the candidate changes.
The tradeoff includes test setup, execution cost and untestable revisions. A flaky or changing predicate can make repeated partitioning misleading. It can be better to stabilize the reproduction or investigate the environment first than to obtain a quick identifier from labels whose meaning is not controlled.
The experiment demonstrates a method for narrowing a constructed boundary, not a measured productivity improvement. Use bisection when its graph search and the available test evidence fit the problem, and preserve uncertainty when the evidence cannot support a unique result.
Action plan: verify the predicate before narrowing history
Write the behavioral question and choose known endpoint revisions. Run the actual predicate at both endpoints in an appropriate isolated context. Record whether the expected application test ran and distinguish setup failures from its observed assertion results before starting the automated partition.
Keep the test script and relevant execution evidence stable across candidate checkouts. Define the launcher's status mapping explicitly, including how it handles untestable builds and unexpected infrastructure failure. A generic nonzero-to-bad rule is not sufficient when that status can be produced before the intended test begins.
Retain the search log and any skipped revisions. If a boundary gap leaves multiple candidates, report those candidates and identify the missing test evidence needed to distinguish them. Do not resolve the uncertainty by silently treating a skipped revision as the outcome that makes the narrative simpler.
End the session and verify restoration in the context actually used. The rehearsal uses a disposable repository and retains it. For a real project, preserve unrelated work and use a suitable isolation strategy rather than copying destructive cleanup commands into a valuable checkout.
FAQ: good, bad and untestable revisions
What did the accepted experiment identify?
It identified revision five as the first bad commit under an invented monotone broken-flag predicate in eight linear commits. That matches the fixture's constructed transition. It does not identify a real product regression or assign responsibility for an actual incident.
Why test both endpoints before bisecting?
The direct checks establish that the intended predicate can distinguish known cases in the current environment. They do not replace intermediate tests, but they can expose a broken reproduction or launcher before its statuses are used to partition history.
What does exit 125 mean here?
The automated search treats it as an untestable revision to skip. The fixture deliberately returns it at revision five in the second run. It is not recorded as a passing or failing application observation for that run.
Why did the skip run return two possible commits?
The missing boundary observation prevented distinguishing revision five from the next known failing revision six. The ambiguity belongs to the available test evidence. The report preserves both candidates instead of inventing a unique conclusion from the skipped case.
Is every nonzero status a valid bad label?
No. The bisect protocol assigns specific meanings to status ranges, while the application wrapper must ensure those statuses represent its intended test. A launch failure can produce a bad-classified status without observing the relevant application behavior at all.
What went wrong in the preliminary Windows run?
A restricted MSYS shell startup failed before the predicate ran inside the search. The external log exposed that absence of actual test executions. The preliminary boundary was discarded, and the accepted run used the access needed for the local shell to start.
Was the production checkout switched during the study?
No. All experimental commits and candidate checkouts were created in verified disposable fixture directories. The script separately checked that the surrounding production commit remained unchanged. It performed no production reset, clean or history rewrite.
Does a search log prove the predicate ran?
It records the search's labels and commands, which is useful but not sufficient for the stronger execution claim. The fixture keeps a separate predicate log showing reached revisions and returned outcomes. That distinction detected the preliminary launcher failure.
Why keep the predicate outside the searched repository?
Candidate checkouts should not silently remove or change the test script whose meaning the search relies on. The fixture retains its predicate outside that checkout. Real investigations should similarly examine how their reproduction and dependencies remain stable across history.
Does a first-bad commit prove root cause?
Not by itself. It is a boundary under a particular predicate and interval. A causal explanation requires examining the change, reproducing the relevant behavior and considering interactions or environmental conditions rather than equating location in history with a complete diagnosis.
Is the number of search steps guaranteed?
The study makes no universal step-count or timing guarantee. The graph, interval and available test outcomes affect the search. Its partition-helper check only confirms a candidate lies inside the constructed interval; it is not a benchmark of investigation speed.
Can this handle a symptom that disappears and returns?
That behavior was not tested. The fixture deliberately uses a single false-to-true transition. A real history with changing behavior needs an appropriate scope and careful interpretation, rather than an assumption that every label fits this invented monotone pattern.
Does bisect reset erase unrelated work?
The article claims only the restoration observed in its clean disposable repository. It does not prescribe recovery for a checkout containing unrelated changes. Use an appropriate isolated investigation context and verify its state rather than assuming this fixture certifies every reset scenario.
Were temporary repositories deleted?
No. The experiment retained its fixture directories and ended their bisection sessions. This avoids a recursive cleanup claim and leaves the accepted logs available for inspection. Retention of these local fixtures is separate from production content and deployment.
What should an honest report include when no unique boundary exists?
Include the tested interval, predicate, skipped revisions, remaining candidates and the missing evidence needed to distinguish them. A bounded uncertain result is more useful than a definitive identifier obtained by relabeling untestable cases without justification.
Recommended books
Pro Git, second edition, by Scott Chacon and Ben Straub, published by Apress in 2014, is available on the official Git site with subsequent online corrections and additions. Its debugging chapter is one primary reference for the workflow. The book recommendation is not independent experimental evidence beyond that cited material.
Version Control with Git, second edition, by Jon Loeliger and Matthew McCullough, published by O'Reilly in August 2012, provides broader version-control context. The official metadata and relevant contents were checked. Current command details and the actual runtime remain the authority for the specific operations executed here.
The Pragmatic Programmer, twentieth anniversary edition, by David Thomas and Andrew Hunt, published in September 2019, offers engineering context for reproducible investigations. Its verified publisher record supports this recommendation; no full-book reading, universal diagnosis or experimental result is attributed to it.
Further exploration
Compare this search with a diagnostic handoff that chooses the next observation after a failed attempt. Both benefit from clear evidence, but the operations differ. Bisection partitions a revision graph under a predicate; a handoff can organize a broader investigation without a history boundary to search.
Also distinguish the disposable repository from an offline project handover. The fixture proves a controlled test history can be searched and restored. It does not audit the completeness of a real transfer, dependencies or access arrangements required to rebuild another project.
The next useful investigation step is to examine the producer of each status your automation trusts. A precise identifier is valuable only when its observations refer to the intended behavior. Keeping that link intact makes a narrowed boundary inspectable and preserves uncertainty where the test never supplied an answer.
Primary evidence sources
- [S1] Actual0 good,1–127except125 bad,125skip,reset and no-checkout passages.
- [S2] Actual bisect helpers select roughly balanced commit boundary in included/excluded graph.
- [S3] Actual worked bisect good/bad and reset sequence read.
Related concepts: systems thinking, wealth structure, and the survival loop. Read the editorial policy and citation guide.