From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7447 invoked by alias); 25 Dec 2016 18:37:54 -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: 22272 Received: (qmail 5401 invoked from network); 25 Dec 2016 18:37:54 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f169.google.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(209.85.217.169):SA:0(-0.0/5.0):. Processed in 4.147456 secs); 25 Dec 2016 18:37:54 -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.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.169 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=YxU3izpB51ecsl8HaMH/EkHfTjuWpHoPh3HIQfNiddA=; b=y2UjXDhrM3FrTYj6Adq1eW5SxlTHNUUX8Qc5wemcLFExJDTkVDDcdLHRmKaSNpzCOo tdGFx9/czmW5VjXSQLHrnwS+ZEifIZsdGUv4RUU+kZnyUTn8g9UNS1+OOIhN/p06jlW7 8S4tUwoliwlqfng89c0CKsL/NNvepEs6A7Z9OAgSG7NX0Xa9YYrlOvee1Lwfp30uRNI7 7NgI6H3jLuU+Ey6LUOveLJEmGje+mBAK/vSzj6PEWmx2otDVFJ4vhRgBU0ASppnc1U7X a98xjYOjzQ6dYIiuA54vgmcxrB4H6nrWvSgD0jXDM/ANKjf6GU9WZf5w0/x816b3+pBz OCcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=YxU3izpB51ecsl8HaMH/EkHfTjuWpHoPh3HIQfNiddA=; b=uSjJYqbgyer+LeO4daxBNI3lEBHL3+8m0USgxuoT+VoGSU5KHqZzS7THV6Nvzd2l3X PLgWx9WHchPS5+8buL+kShyMfDonn9KxsjDum15xWYGB7yGmwkQBIQ9AtTW6HILSzph1 iVKxRJ0rBtl3Cqu24QnD4McHHNq6EYFqjRB0i8lg9SnpELg0A3MzamUGB9+05snIU5mr 9yC/+/+Tc+eMP/mpKy4a9btyG365ToNYKMDjWlykn1S8YovSMxZIdS4ekVFXHrl1BeSp mHU9t2UDeesjdZjAL3RifeouD8rx3eLo40O/P6Ctv3Puo1dcN6eG3OcVzsbHkLPNba5y nM/A== X-Gm-Message-State: AIkVDXIi52BtOqZ0AXrthzcoZuKRMUa+KqAArRorZ+K5g/B8dR7BgZ5Td6tkMX0w7wZbAg== X-Received: by 10.176.76.45 with SMTP id l45mr13038116uaf.132.1482691062920; Sun, 25 Dec 2016 10:37:42 -0800 (PST) From: Bart Schaefer Message-Id: <161225103748.ZM26271@torch.brasslantern.com> Date: Sun, 25 Dec 2016 10:37:48 -0800 In-Reply-To: <20161225145145.GA14409@fujitsu.shahaf.local2> Comments: In reply to Daniel Shahaf "Idea: automatic dotfiles bisection (and minimal example extraction)" (Dec 25, 2:51pm) References: <20161225145145.GA14409@fujitsu.shahaf.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Idea: automatic dotfiles bisection (and minimal example extraction) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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".