zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: PATCH: short-circuiting glob exclusion operator
Date: Tue, 22 Mar 2016 09:46:14 +0000	[thread overview]
Message-ID: <20160322094614.13b07bf4@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <160321155421.ZM27019@torch.brasslantern.com>

On Mon, 21 Mar 2016 15:54:21 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Mar 21,  6:36pm, Peter Stephenson wrote:
> }
> } This is a request for comments for now.  I'm not yet entirely sure the
> } pattern syntax with two tildes isn't going to cause problems (though I
> } don't see what they would be), or that I've identified all the side
> } effects that can happen.
> 
> As Mikael has already pointed out, files with names ending in a tilde
> followed by an exclusion pattern may cause trouble with this.

Yes, they do: the logic was that if it saw "~~" in the middle, the first
"~" couldn't be an exclusion, because there was nothing after it other
than another "~" (exclusions have to be non-empty patterns), so it was
treated as quoted.  This would change.

~# might work instead.

> } As an ultra brief summary, ~~ in a glob introduces a pattern that will
> } prune directories on the way through in addition to acting in the normal
> } exclusion fashion.
> 
> I don't suppose it would instead be possible to special-case something at
> the END of the pattern?  E.g. **/*~*/foo/** where the trailing /** means
> to prune at whatever precedes it.

That's quite hard to parse; you're happily looking at a normal "~" and
then you find right at the end that actually it doesn't belong within
the pattern at all, instead it belongs higher up with the hierarchy of
file patterns (although ~ is already hacked a bit to apply to the whole
pattern in ways I haven't quite got to the bottom of again).

What worries me most is pat~foo~bar is supposed to exclude both
foo and bar, and I'm not sure how that could fit in here.

> I suppose that conflicts with the new GLOB_STAR_SHORT option, although
> ultimately it means exactly the same in context.

It doesn't, really, since directories aren't specially handled after the
~, or could in principle be specially handled by different means.

> Aside:  Do we really want to add this before we've figured out the
> background for "Extended globbing seems to have become much slower"?

No hurry, but I have no idea where that's going and we already seem to
have excluded most of the things we know about...

pws


  reply	other threads:[~2016-03-22  9:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 18:36 Peter Stephenson
2016-03-21 20:39 ` Mikael Magnusson
2016-03-21 22:54 ` Bart Schaefer
2016-03-22  9:46   ` Peter Stephenson [this message]
2016-03-22 11:46     ` Jesper Nygårds
2016-03-23  9:56       ` Peter Stephenson
2016-03-26 15:40     ` Bart Schaefer
2016-04-07 20:10       ` Peter Stephenson
2016-04-08  3:18         ` Bart Schaefer
2016-04-09 18:22           ` Peter Stephenson
2016-04-09 19:00             ` Mikael Magnusson
2016-04-09 19:51               ` Peter Stephenson
2016-04-10  5:40                 ` Bart Schaefer
2016-04-10 12:11                   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160322094614.13b07bf4@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).