Re: [PATCH/RFC] attr: allow pattern escape using backslash
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Oct 6, 2012, 08:02 UTC
- Message-ID
- <CACsJy8BtfeJF=tov7nPMSjXuKjisJfNfHQ_eLjwYC=GTJP12rQ@mail.gmail.com>
- In-Reply-To
- <7vzk40qbm1.fsf@alter.siamese.dyndns.org>
On Sat, Oct 6, 2012 at 2:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Shouldn't we do the same for quoting fnmatch(3) metacharacters? To > match a path component 'a' followed by an asterisk followed by 'b', > you could then write 'a\*b'. Same for quoting the backslash itself.
I think my patch does that too. The thing it does not do is optimize this case so that we can do strcmp() instead of fnmatch() if the entire pattern does not contain any metacharacters but backslashes. I don't think it'll become popular enough to deserve an optimization.
-- Duy