zsh-users
 help / color / mirror / code / Atom feed
* Idea: automatic dotfiles bisection (and minimal example extraction)
@ 2016-12-25 14:51 Daniel Shahaf
  2016-12-25 18:37 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Shahaf @ 2016-12-25 14:51 UTC (permalink / raw)
  To: zsh-users

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?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-25 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-25 14:51 Idea: automatic dotfiles bisection (and minimal example extraction) Daniel Shahaf
2016-12-25 18:37 ` Bart Schaefer
2016-12-25 18:46   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).