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 27, 2015, 16:35 UTC
Message-ID
<2578959.p0AHc2Ulk9@pinguin>
In-Reply-To
<m2oagotf1d.fsf@linux-m68k.org>
On Sunday 27 September 2015 10:58 Andreas Schwab wrote:
Show 5 quoted lines
> 
> ] by itself is not special in a glob.
> 
> Andreas.
> 
OK, this would explain the current state: once Git sees opened bracket, it always tries to parse the glob pattern and if this fails (if the bracket is not closed), the ignore rule does not match anything. This does not happen for closing bracket and therefore the difference in behavior.
Thanks!

P.S. In case anyone is interested, here is the path for JGit: https://git.eclipse.org/r/#/c/56773/4

-- 
Kind regards,
google.com/+AndreyLoskutov
Previous: Andreas SchwabNext: Duy Nguyen
Message 3 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.