Re: [PATCH] Support \ in non-wildcard .gitignore entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, 10 Feb 2009, Finn Arne Gangstad wrote:

> On Tue, Feb 10, 2009 at 01:56:36PM +0100, Johannes Schindelin wrote:
> > Hi,
> > 
> > On Tue, 10 Feb 2009, Finn Arne Gangstad wrote:
> > 
> > > 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?
> 
> Currently, \#abc does not match a file named #abc, but \#abc* does.
> With the patch, both will match.

Ah, so I was wrong, and the test case would not have to be disabled on 
Windows.

Thanks,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux