Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Idea: automatic dotfiles bisection (and minimal example extraction)



I'm tired of having to ask people to bisect their zshrc to find minimal
reproducers for bugs they report.

I was thinking, we could write an automatic bisector, similar to
git-bisect(1), which operates on zshenv,zprofile,zshrc, and
automatically reports which statement in those files causes the problem.

A simplistic version would simply split the file by lines, and deal with
the case that a particular split is invalid (say, includes a '{' token
but not its matching '}' token) by trying to split a few lines above or
below, like «git bisect run» does when its argument script exits 125.

A more intelligent version would use the ${(z)} tokeniser to split the
file on statement boundaries.  (It would basically need to keep track of
nesting level into subshells, {…} blocks, and control structures
(done/fi/esac); statement ends are represented as «;» array elements.)

Once "report which line causes the problem to appear" is implemented,
a future feature would be to start weeding out _other_ statements whilst
the problem still reproduces, and thereby automatically construct
a minimal reproduction script. :-)

Does such a thing exist?  Does anyone plan to implement it?



Messages sorted by: Reverse Date, Date, Thread, Author