Zsh Mailing List Archive
Messages sorted by:
Re: [RFC] Case-insensitive path completion in _git
- X-seq: zsh-workers 48285
- From: Oliver Kiddle <opk@xxxxxxx>
- To: dana <dana@xxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [RFC] Case-insensitive path completion in _git
- Date: Sun, 28 Mar 2021 10:08:17 +0200
- Archived-at: <https://zsh.org/workers/48285>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/59566-1616918897.215402%406qHq.M4f6.Ov84>
- In-reply-to: <1C958552-603A-4716-8D4B-EF1EDA6D304F@dana.is>
- List-id: <zsh-workers.zsh.org>
- References: <B25A8850-A141-4B81-A3E6-017F280B0CC6@dana.is> <email@example.com> <20210327210826.GJ18178@tarpaulin.shahaf.local2> <1C958552-603A-4716-8D4B-EF1EDA6D304F@dana.is>
> I recently learnt that ls-files actually does support case-insensitive
> matching using the following syntax:
That applies to the whole path including the directory components which
I don't thing we'd want in this case - but correct me if I'm wrong.
It doesn't appear to support
The only reference to the feature I could find was in the top-level
git.1 man page so maybe the syntax is different.
You can also pass --icase-pathspecs or set an environment variable.
> 'git ls-files -- /home/dana/linux/'*Kbuild*'' ran
> 1.18 ± 0.04 times faster than 'git ls-files -- ':(icase)'/home/dana/linux/'*kbuild*''
> 2.60 ± 0.09 times faster than 'git ls-files -- /home/dana/linux/'*[Kk][Bb][Uu][Ii][Ll][Dd]*''
That doesn't look too bad at all but I tend not to work in big trees
like the Linux kernel. :(icase) may be worse for a deeper path where
it adds extra directory matches. Did you run these benchmarks on a
case-sensitive or insensitive file-system?
Strictly speaking, we should use * and rely on zsh completion matching
to do the filtering instead of giving git the contents of $PREFIX
anyway but that'd really slow it.
> It could still be gated behind a style if it's a concern.
I don't think thats necessary. Committing as per the original patch
seems good to me.
Messages sorted by: