From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Idea: automatic dotfiles bisection (and minimal example extraction)
Date: Sun, 25 Dec 2016 14:51:45 +0000 [thread overview]
Message-ID: <20161225145145.GA14409@fujitsu.shahaf.local2> (raw)
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?
next reply other threads:[~2016-12-25 15:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-25 14:51 Daniel Shahaf [this message]
2016-12-25 18:37 ` Bart Schaefer
2016-12-25 18:46 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161225145145.GA14409@fujitsu.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).