From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20327 invoked by alias); 6 Jun 2014 02:54:04 -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: 32725 Received: (qmail 7056 invoked from network); 6 Jun 2014 02:54:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=mesmtp; bh= zhFvVm5dIK7WLBFr5BM6bAEmmLs=; b=pCQ+xxlLDnichVn9u0jTb2PW2FwlQ7ii Y4Y9Ndo1rlPnp3XX/OWdLtWxqh0ku09+Y5352k2/m/sR/3UQzgZl1Aoa91kxhJJv 95XLHICuAw8/UrXoIYRjd/3kXw5AYSRN5wzBq6eu3dYmVzCrYioJA1ds8Fpvty/a /WTaps8s02c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=zhFvVm5dIK7WLBFr5BM6bAEmmLs=; b=uqsxYOEYu0woM9fF1QXue7HBprwF W6Jsj2G2rCFX86+P3JvicfDjBLN7ItFCG4eSmTkTm3Q2Regm+iT6IiHTudXd2QjU 53LYasPnm2EyLQsi52u8/FZPQlh8sueLJF3RMFUMrLGsbjpM9dRDaJL0BB9y/R+u PjXxMkDigXQPx98= X-Sasl-enc: GYfbGWpDwvFT+n36GBtBpxESP9grwJ1Y5z7yOLQkkGmH 1402022723 Date: Fri, 6 Jun 2014 02:45:19 +0000 From: Daniel Shahaf To: Oliver Kiddle Cc: zsh-workers@zsh.org Subject: Re: [PATCH] Re: (Y) modifier: up to N matches? Message-ID: <20140606024519.GD2055@tarsus.local2> References: <20140602182346.GB1858@tarsus.local2> <140602204603.ZM26905@torch.brasslantern.com> <20140604020804.GA2032@tarsus.local2> <140603234229.ZM29030@torch.brasslantern.com> <20140604230835.GD1970@tarsus.local2> <25969.1402010685@thecus.kiddle.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25969.1402010685@thecus.kiddle.eu> User-Agent: Mutt/1.5.21 (2010-09-15) Oliver Kiddle wrote on Fri, Jun 06, 2014 at 01:24:45 +0200: > Considering uses of the new (Y) modifier as I've understood it: I > commonly use (../)# to find the top-level of something. For example > (../)#.git(:h) will find the top of a git checkout. It'd be useful if > this would stop searching after the first match which should be the > one that involves going up as few directories as possible. It does: % setopt extendedglob % cd $(mktemp -d) % mkdir -p foo A/foo A/B % cd A/B % echo (../)#foo(:A:h:t) A tmp.Ykz8jNBvJo % echo (../)#foo(Y1:A:h:t) A (Also: 'git rev-parse --show-toplevel') > I'm also inclined to think that with downward globs that you'd want it > to find the nearest match so checking files before directories. That's the current behaviour: % mkdir -p A/B/foo A/foo % echo **/foo(Y1) A/foo It may be worthwhile adding a unit test for this to Test/D02glob to ensure this behaviour doesn't change. Daniel >