Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PR] vcs_info-examples: optimize +vi-git-untracked() #76
- X-seq: zsh-workers 49131
- From: Frank Terbeck <ft@xxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxx>
- Cc: "Suraj N. Kurapati" <sunaku@xxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: [PR] vcs_info-examples: optimize +vi-git-untracked() #76
- Date: Sun, 27 Jun 2021 12:04:56 +0200
- Archived-at: <https://zsh.org/workers/49131>
- In-reply-to: <96030-1624785233.702771@PUMF.Qbc8.FJES> (Oliver Kiddle's message of "Sun, 27 Jun 2021 11:13:53 +0200")
- List-id: <zsh-workers.zsh.org>
- References: <20210626230903.43ba5516@ratham> <96030-1624785233.702771@PUMF.Qbc8.FJES>
Oliver Kiddle wrote:
> "Suraj N. Kurapati" wrote:
[…]
>> Speed up the prompt on large and/or deep working directories by
>> stopping grep(1) as soon as it finds a single match, with `-q`.
>
> The -q option to grep isn't strictly portable. It is certainly lacking
> on Solaris. It is more reliable with egrep but that may not be faster.
> It does seem to be there on Linux and the main BSDs so I don't know
> whether we should still care about this.
I think having this in an example is fine. We're using "grep -q" in
other places, too. Not that it matters much, but ‘-q’ is part of SUSv3.
Maybe vendors should be asked to implement it therefore. :)
In any case, I think its use in examples of documentation is fine. If
you're plagued with an implementation that doesn't implement -q, you get
to work around it.
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author