Re: [JGIT PATCH v3 0/23] Implementation of a file tree iteration using ignore rules.

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

 



söndagen den 8 juni 2008 18.37.30 skrev Florian Köberle:
(please retatain who said what)
> >> Unsupported are colon expressions like ":alpha:". I didn't expect git-add to support it, but as I just noticed git does.
> > Maybe we should anticipate it and throw an exception if one tries the pattern and not treat it as [alph:] .
> > 
> > Well we noted they were broken in Git so (separate thread) so we may as well try something sane. 
> Just did some tests and noted that the shell and git does not support 
> them. I guess I thought that they work because [:alpha:] matched "a".
> 
> Hi Robin
> 
> The bash shell doesn't support [:alpha:] too:
> $ mkdir test
> $ cd test
> $ touch a
> $ touch b
> $ touch :
> $ ls [:alpha:]
> :  a
Oh, it does. [:alpha:] is a character class, like a-z. So you use [[:alpha:]], which is what git as well as bash
understands.

> The fnmatch function of the python module fnmatch 
> (http://docs.python.org/lib/module-fnmatch.html) does not support 
> :alpha: too.
> 
> example:
> $python
>  >>> from fnmatch import fnmatch
>  >>> fnmatch("a","[:alpha:]")
> False
Hmm. Odd:

$ python
Python 2.5.2 (r252:60911, Apr 12 2008, 01:47:55)
[GCC 4.2.3 (4.2.3-6mnb1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from fnmatch import fnmatch
>>> fnmatch("a","[:alpha:]")
True

But then, it's matching the a(s), not the character class.

>>> fnmatch("x","[:alpha:]")
False
>>> fnmatch("x","[[:alpha:]]")
False

-- robin
--
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