From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21819 invoked by alias); 27 Jun 2016 00:20:38 -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: 38764 Received: (qmail 22629 invoked from network); 27 Jun 2016 00:20:36 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Date: Mon, 27 Jun 2016 00:20:31 +0000 From: Daniel Shahaf To: Mikael Magnusson Cc: zsh-workers@zsh.org Subject: Re: [PATCH v2 2/3] Fix the ':A' word modifier on paths with '..' components. Message-ID: <20160627002031.GA20366@tarsus.local2> References: <20160613085218.GA9572@tarsus.local2> <1466474004-4669-1-git-send-email-danielsh@tarsus.local2> <1466474004-4669-2-git-send-email-danielsh@tarsus.local2> <20160625162807.GA9840@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Mikael Magnusson wrote on Sat, Jun 25, 2016 at 18:47:58 +0200: > On Sat, Jun 25, 2016 at 6:28 PM, Daniel Shahaf wrote: > > Mikael Magnusson wrote on Tue, Jun 21, 2016 at 05:08:16 +0200: > >> On Tue, Jun 21, 2016 at 3:53 AM, Daniel Shahaf wrote: > >> > The fix is to stop calling chabspath() at the top of chrealpath(). > >> > > >> > Preserve the old behaviour when CHASE_DOTS is set. > >> > >> I think this is backwards, cd symlink/.. gets you to the current dir > >> if chasedots is unset, and to wherever symlink points' parent > >> directory when it is set. > > > > True. > > > > However, I don't want to just flip the condition (change "if isset()" to > > "if unset()") since I think the new behaviour (resolving symlinks before > > '..' components) should be the default for :A. > > > > So how about adding a new option and having chrealpath() use the new > > behaviour if the new option is at its default value, and the old > > (':a'-ish) behaviour otherwise? > > That sounds pretty pointless, you would still break existing scripts, Yes, that's the whole point: I think the "new" semantics should be the default. > and make everyone have to versioncheck to see if they have to enable > an option or not. No version check is needed, people can change foo:A to foo:a:A or do setopt colonA_please_be_compatible_with_fivedottwo 2>/dev/null || true once at the top.