Skip to main content

parse_bisect_vars

Function parse_bisect_vars 

Source
pub fn parse_bisect_vars(out: &str) -> (Option<usize>, Option<usize>)
Expand description

Parse git rev-list --bisect-vars output into (revisions_left, steps).

This is plumbing git provides precisely so callers do not reimplement the bisection arithmetic. An earlier attempt here computed “revisions left” as count(rev-list bad ^good) - 1, which is wrong and quietly so: for eight commits it said 6 where git says 3. Git does not report the size of the remaining range — it reports the size of the worst-case half after the midpoint it just chose, which is the bisection algorithm, not a subtraction. Showing a number that disagrees with what git bisect prints in the same terminal is worse than showing none.

The format is key='value' or key=value, one per line.