From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13249 invoked by alias); 17 Aug 2016 07:02:41 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39048 Received: (qmail 2091 invoked from network); 17 Aug 2016 07:02:41 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f193.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.192.193):SA:0(0.0/5.0):. Processed in 0.15799 secs); 17 Aug 2016 07:02:41 -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=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: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) 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=hJYuIQ0egDDcJ4OwneG6IW8pkjI6FYTqUIO+99pjDB0=; b=lZpkusa+P7SALsRT/jMmCAfbKGVVdfSKyKM5IbPtx+Rh3MzCPG+4SzLbl/0HLL+UEb 5NTHJzxbCSnJk0jBupdPK1/JFiDh6tbqnnvshy6mMNBlcfzFg0AqcfHW6I1ht7oqVOpf BimA/w8HS3kz7IRyFe2T3bwkJ5QHuhiVCsCXs7ktFld1YrIGdHxL9x5+EzUdKWDAYsu4 NVLUUe6ynxhQHEzJNQAMFk83h4qSDdltqBfqqUbev8jlcUxf1ljDldUNwE32/IWHXP3h yc7tTR4DwmGmym8Gw8x9Iu82vJzH0LPGc9JsTjhrC9LEHm0isax+2jyNByXOvvQJ9V8N nGqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=hJYuIQ0egDDcJ4OwneG6IW8pkjI6FYTqUIO+99pjDB0=; b=DxEJxnzxv3UyLwOBRASlBwdpNjljMgLmdMQbb/wmbuvQP1aXknfm81p6sc84Yc3iwf iE5tga0V7PgfQsPHnZI38HjyGT6pKQ0tXsbzeSRIPbDlOohkPcNZQdklxVnmnWtmLjFm eP9Ty81Mub/6xr93nTH/jp5IlS37sHVQC1RO7TAmfRPLX7P8P55j5SOSmvMI/tBfQQ+c UajAz6MHVqBP3AGdMkS22mTiUbTKhm33vA6f6+eLqDZ7JF8pFUgCSLtEyy2v6YPmhZ/e 0Ic3YUMxQ7g+RjgXnYE0CNkV8p65Zkw92sqHkA3zNw7EiNtfTuNWYWteyFmf4ss1aEbR fGAQ== X-Gm-Message-State: AEkoouv+mgx7SbniGBVoJvCwY8oqmNx76fadFzk/DFD3bsvBr7WtWQDyV6Sq+VenV8hkwg== X-Received: by 10.98.92.65 with SMTP id q62mr71994542pfb.70.1471417353634; Wed, 17 Aug 2016 00:02:33 -0700 (PDT) From: Bart Schaefer Message-Id: <160817000240.ZM19759@torch.brasslantern.com> Date: Wed, 17 Aug 2016 00:02:40 -0700 In-Reply-To: <1471391679-9604-1-git-send-email-danielsh@tarsus.local2> Comments: In reply to Daniel Shahaf "[PATCH] New :P history modifier." (Aug 16, 11:54pm) References: <1471391679-9604-1-git-send-email-danielsh@tarsus.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [PATCH] New :P history modifier. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 16, 11:54pm, Daniel Shahaf wrote: } } WDYT? The code changes are essentially OK; my only thought is, maybe we should just remove the dependency on the POSIX realpath() call even from :A, and use xsymlink() everywhere? Picking at the docs ... Given that we went to the trouble of hashing it out, it is probably worth noting that :a is intended to result in the path to along which "cd" would change under the default setopts (no_chase_dots), and :A is meant to result in the physical directory at the end of that path. } + "a:absolute path, resolve '..' logically" } + "A:same, then resolve symlinks" } + "P:realpath, resolve '..' physically" You should spell out what "same" means, because the two descriptions may not always appear together. I'm not sure "logical" and "physical" are the right words here, but "by text replacement" and "by filesystem reference" seem a bit too verbose, so I don't have a suggestion, just calling attention. (Aside: The doc for "cd" doesn't ever describe how it behaves when CHASE_DOTS is not set; the user is left to infer it from the doc that explains what happens when CHASE_DOTS is set.) } +The new word modifier ':P' computes the realpath() of the argument. } +It is different from the existing ':a' modifier which does not resolve } +symlinks, and from the existing ':A' modifier which always resolves ^^^^^^^^ If you're going to compare to both :a and :A, symlinks aren't the largest difference vs. :a -- following ".." is. In fact I'd say following ".." is more important to the distinction than symlinks are. } +/before/here/../after to /before/after --- even if /before/here is } +a symbolic link. It is recommended to review uses of ':A' and, if } +appropriate, convert them to ':P' as soon as compatibility with 5.2 is } +no longer a requirement. So how about e.g.: The new word modifier ':P' computes the physical path of the argument. it is different from the existing ':a' modifier which does always resolves /before/here/../after to /before/after, and differs from the existing ':A' modifier which resolves symlinks only after here/.. is removed even when /before/here is itself a symbolic link. That's all.