From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6898 invoked by alias); 25 Dec 2016 15:06:23 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22271 Received: (qmail 21697 invoked from network); 25 Dec 2016 15:06:23 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(-0.7/5.0):. Processed in 1.224234 secs); 25 Dec 2016 15:06:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=b8sIi2rZSuSrJWE QVgInuc4tP54=; b=xIGO3K2eC0e38cGtN4iqwOKjjdaVLvvN4r6Sq15xtiyi+5f ol8uJL9LecsgENWtUDIL9z+90ovTbN5ukfD3J/xWxQ9307DqYvlGcX12rgoZ7a3s LzM9HTWz0htV+BD9+YCo9mUrfbGyvmiu1x6TnQvnkWovsDxE/nmibNggyYCE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=b8sIi2rZSuSrJW EQVgInuc4tP54=; b=hiF5Zo8IYe4Jvx9hzYY9TG6OyN99jtovpwszyYYMRflIGc vETknP6x5zZ8Kny82RX5OgvfyFcILoLdCzeb36wRQPrVpRitFBFPFqNz8DVP0GnP +dB6wS3GONR2umJxBysRPEgbt+pf2I+F+BH3MOIecnR62TPBeIHyIkcT0eNRU= X-ME-Sender: X-Sasl-enc: wq0od8bc2ypcq8Rl5ABWTqDgnofgQi+4iUB96BPhUPip 1482677685 Date: Sun, 25 Dec 2016 14:51:45 +0000 From: Daniel Shahaf To: zsh-users@zsh.org Subject: Idea: automatic dotfiles bisection (and minimal example extraction) Message-ID: <20161225145145.GA14409@fujitsu.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) 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?