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

Re: Single brackets matching in .gitignore rules

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Sep 27, 2015, 08:58 UTC
Message-ID
<m2oagotf1d.fsf@linux-m68k.org>
In-Reply-To
<2606743.RipZrg6Xoz@pinguin>
Andrey Loskutov <loskutov@gmx.de> writes:
Show 12 quoted lines
> Next, the surprising table for ']':
> ----------------------
> rule  | file | match?
> ----------------------
> ]           ]          true
> ]*         ]          true
> *]         ]          true
> *]         a]        true
> ----------------------
>
> Here Git does not give up on parsing, treats unmatched ']' character literally, and doesn't dislike that it is an "unmatched" end of a broken character group.
> Why?
] by itself is not special in a glob.
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Andrey LoskutovNext: Andrey Loskutov
Message 2 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.