Re: [PATCH] Support \ in non-wildcard .gitignore entries
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 10, 2009, 12:56 UTC
- Message-ID
- <alpine.DEB.1.00.0902101354460.10279@pacific.mpi-cbg.de>
- In-Reply-To
- <20090210121149.GA1226@pvv.org>
Hi,
On Tue, 10 Feb 2009, Finn Arne Gangstad wrote:
Show 10 quoted lines
> If you had an exclude-pattern with a backslash in it, e.g. "\#foo", > this would not work, since git would do a strcmp of the exclude pattern > and the filename. Only wildcard patterns were matched with fnmatch, > which does the right thing with backslashes. We now also treat all patterns > containing backslashes as wildcards. > > De-escaping the pattern while reading the .gitignore file is error prone, > since that would break patterns with both backslashes and wildcards. > E.g. "\\*.c" would be translated to "\*.c" before fnmatch got it, > and would change the meaning of the rule dramatically.
I am not sure I understand (maybe a test case would help, but that test case would have to be disabled on Windows, I guess):
You mean that '\#abc' would match '\#abc', but '\#abc*' would not?
Ciao, Dscho