git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C Hamano
Message 3 of 3 in “attr: allow pattern escape using backslash”
  1. attr: allow pattern escape using backslashNguyễn Thái Ngọc Duy, Oct 6, 2012
  2. Junio C HamanoOct 6, 2012
  3. Nguyen Thai Ngoc DuyOct 6, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.