Workflows
Bisect Regression Triage Workflow
When something recently broke but ownership is unclear, use git bisect to isolate the first bad commit quickly and reproducibly.
- Teams turning commands into repeatable routines
- Readers who need sequencing, branch, and sync discipline
- Basic understanding of fetch, pull, push, and branches
- A sense of how and why branches diverge
- Copying a workflow without checking branch state
- Choosing the wrong integration path on shared branches
For many regressions, the longest phase is not fixing but identifying which commit introduced the break. git bisect replaces linear guessing with logarithmic narrowing.
When to start bisect
- the regression is confirmed but commit range is wide
- manual log scanning is too slow or inconclusive
- you can define a clear pass/fail check for each midpoint
Setup checklist before running
- Reproduce the issue reliably on your machine or CI.
- Identify one known
goodcommit and one knownbadcommit. - Prepare a repeatable verification command.
Core sequence
git bisect start
git bisect bad
git bisect good <good-commit>
At each midpoint, run your verification:
# example
npm test -- login-regression
Then classify:
git bisect bad
# or
git bisect good
Once converged:
git show
git bisect reset
Prefer automated bisect when possible
If your check is scriptable:
git bisect start <bad-commit> <good-commit>
git bisect run ./scripts/repro-check.sh
Automation removes human inconsistency and turns triage into reusable infrastructure.
Handoff from triage to fix
After isolating the first bad commit, you usually choose among:
- patch-forward on main
- revert the offending change (if impact is bounded)
- disable behavior temporarily with a feature flag
Bisect is a localization tool, not a repair command.
If your pass/fail signal is noisy, bisect output is unreliable. Stabilize reproduction criteria first, then run binary search.
Common mistakes
Mistake 1: weak good/bad boundaries
Ambiguous boundaries distort the whole search path.
Mistake 2: forgetting git bisect reset
You can remain on an intermediate commit state and accidentally continue unrelated work there.
Mistake 3: treating the first bad author as the whole root cause
The introducing commit is evidence, not always full causality. Review dependency and context.
- Write the bad symptom and minimal reproduction path.
- Record a verified good historical point.
- Script the verification check.
- Capture first bad commit plus chosen remediation path.
Good follow-up reads
git-bisectHotfix and urgent fixesRecover after reset