From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Idea: automatic dotfiles bisection (and minimal example extraction)
Date: Sun, 25 Dec 2016 10:37:48 -0800 [thread overview]
Message-ID: <161225103748.ZM26271@torch.brasslantern.com> (raw)
In-Reply-To: <20161225145145.GA14409@fujitsu.shahaf.local2>
On Dec 25, 2:51pm, Daniel Shahaf wrote:
}
} 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.
Assorted thoughts:
A place to start might be https://github.com/rocky/zshdb
git-bisect works because it has the git revision history to play with.
Trying to apply that within a single revision of a structured file may
be more trouble than the binary search is worth.
Most difficult is if the error appears inside a multi-line construct,
in which case you have to retain e.g the "done" or "else"/"fi" for
the whole thing to remain valid. Certain "bisects" would end up
having to have overlapping start/end to be parseable.
So if this is going to be automated anyway, it might be better to
just do it brute force -- start at the end of the file, delete one
statement, if the error is still there put that one back and delete
the one above it, repeat.
For init-file debugging in particular, it might be possible to get a
long way by using a carefully designed PS4, capturing the output of
a full pass through the init file with xtrace, and then examining
that to find line numbers for where to make a clean break.
You're still going to run into trouble if the problem is because of
an option setting where the user has planted a whole list of options
in a single call to "setopt".
next prev parent reply other threads:[~2016-12-25 18:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-25 14:51 Daniel Shahaf
2016-12-25 18:37 ` Bart Schaefer [this message]
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=161225103748.ZM26271@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--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).