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

Re: Single brackets matching in .gitignore rules

From
Andrey Loskutov <loskutov@gmx.de>
Date
Sep 28, 2015, 17:46 UTC
Message-ID
<4259524.1vtm9ffbuH@pinguin>
In-Reply-To
<xmqq7fnae92a.fsf@gitster.mtv.corp.google.com>
On Monday 28 September 2015 10:40 Junio C Hamano wrote:
Show 12 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
> 
> > This is already answered. I just want to add that C Git has stopped
> > using system fnmatch for some time (part of the reason is system
> > fnmatch behaves differently in corner cases). If you don't mind C,
> > have a look at dowild() in wildmatch.c, or t/t3070-wildmatch.sh for
> > some corner cases (but your cases aren't there, may be worth adding
> > too)
> 
> What exactly are you suggesting to "fix", though?  Barf when an
> unmatched ] appears as a part of the pattern, instead of taking it
> literally?

I would rather treat the opened but unmatched [ bracket literally, so that it works similar like ]. Originally I've implemented this "symmetrical" behavior in JGit without to know that unmatched [ and ] have different behavior in C Git.

-- 
Kind regards,
google.com/+AndreyLoskutov
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 7 in “Single brackets matching in .gitignore rules”
  1. Andrey LoskutovSep 26, 2015
  2. Andreas SchwabSep 27, 2015
  3. Andrey LoskutovSep 27, 2015
  4. Duy NguyenSep 28, 2015
  5. Junio C HamanoSep 28, 2015
  6. Andrey LoskutovSep 28, 2015
  7. Junio C HamanoSep 28, 2015

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.