From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id f5abeb72 for ; Fri, 28 Jun 2019 09:24:59 +0000 (UTC) Received: (qmail 8067 invoked by alias); 28 Jun 2019 09:24:52 -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: List-Unsubscribe: X-Seq: 44465 Received: (qmail 6444 invoked by uid 1010); 28 Jun 2019 09:24:52 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f51.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25489. spamassassin: 3.4.2. Clear:RC:0(209.85.221.51):SA:0(-2.0/5.0):. Processed in 2.075823 secs); 28 Jun 2019 09:24:52 -0000 X-Envelope-From: stephane.chazelas@gmail.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.221.51 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=rfP5576nfnllGNSWnJRu3N6F363HaSvJ1tcA/PClmjc=; b=IkbxLiUsTm7plf83xPMlOupWH9gsuJ7FqkT/C164fKPCLd1BpueGdk1AU6j2moU5KR 7xYZ58e2SBeXs6/UhF1tAWJiSPYWzN9Ue7xjqPN0r5QAQ91AqpRTj/B8Sp6wAhA5lDV1 8GWgcVftaDt7i16RLBhe/VGq7mRwq4GNunkUyPb1C72sTPSgo1M7ERHWX5pRw3Se6p5d tpbJxSmVlv7L718/YOY61FCo/NZCJmwNip7hJBV/NjpjqQAP4IjmiLIu+m0cZa9834/4 EgMwwxKcG6r6mYOibOmSb//FXVDbcjxU0KxHucnsnpAF3+RG+a63pfNQOdpHGc7UdtrA o8NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :mime-version:content-disposition:user-agent; bh=rfP5576nfnllGNSWnJRu3N6F363HaSvJ1tcA/PClmjc=; b=Lmlo5zsJeTFCTVQ6VeTG/6mxIdS3cUZr8+LZcM+0lvsljAqhefUyRrDbPTYy8loIGD 2FojWNMkZI0wNiJeagLnMziGLXLMFbt2jq3dYoktypubS47UeoQwS2WaYV1fsAKf7uUa 3DPeNKlRQnwA7/yH3fGw4iHBXFuib3z0pS8k69Du+WQyz/y5yQC06PTlvFJQ5YImwP3Z B/Vfap/lOdQ6w7geVDgeKnw5zhOOceJwFr3PcjHWRJ+Yym7s85JkcRYw1slcueoSnq7Q SM92fEULcDu2faDHhAKxncqbomB1eVKRPvLgMFqA7N3x/2UesdBJ9TAxgzL9t7XKD6g1 XBtQ== X-Gm-Message-State: APjAAAWiXHinV7h2nuSrls7pcMQVe4rxZu1S3GNf0IkEY627q056ECAR uX3LMW8nZKvHt+vZXD6eROeDtDr9 X-Google-Smtp-Source: APXvYqxWYVmvfkXoTCO58i3xNmm4zWMXCAlkNaVyQnbPYDvu8zxpsBtjtzQidGd2LZcRZy269rcmLw== X-Received: by 2002:adf:df10:: with SMTP id y16mr7337760wrl.302.1561713855067; Fri, 28 Jun 2019 02:24:15 -0700 (PDT) Date: Fri, 28 Jun 2019 10:24:13 +0100 From: Stephane Chazelas To: Zsh hackers list Subject: */file glob and directory symlinks Message-ID: <20190628092413.7j6vcw2mx3vg3pmz@chaz.gmail.com> Mail-Followup-To: Zsh hackers list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20171215 Hiya, it's something that's been bothering me for a while: $ mkdir dir $ ln -s dir link $ touch file dir/file $ echo **/file file dir/file "link" is not followed, which is what I expect (same for (*/)#file or (*/)##file). If I want the link to be followed, I can use $ echo ***/file file dir/file link/file Fine (though there's no link-following equivalent for (^CVS/)# for instance) Now in $ echo */file dir/file link/file symlinks are always followed and there's no way to disable it, other than doing things like $ echo **/file~*/*/* dir/file which finds every file at any depth and then excludes the ones at depth other 2 so is not really usable in practice. These don't work: $ echo (*/)file zsh: bad pattern: (*/)file $ echo (*/)(#c1)file zsh: bad pattern: (*/)(#c1)file Maybe we could have a glob qualifier that prevents following symlinks, or support (*/) as the non-following variant of */ even when it's not followed by "#" or "##", or have per-path component glob qualifiers like *(#q^@)/file (which could have other uses like (*(#q^u:0:)/)#file to skip looking into dirs owned by root)? What do you think? -- Stephane