Per branch ignore exclusions
Neil Martinsen-Burrell
nmb at wartburg.edu
Fri Sep 11 22:27:22 BST 2009
On 2009-09-11 13:07 , John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> John Whitley wrote:
>> Martin Pool<mbp<at> canonical.com> writes:
>>> Since we support Python regexps in ignore rules, it may already be
>>> possible to use a negative-match regexp to do this. If there is, it
>>> should be documented as as recipe; if not it would be worth filing or
>>> duping a bug.
>>
>> I didn't see a dupe, so I filed as:
>> https://bugs.launchpad.net/bugs/428031
>>
>> Good idea, re: regexps. Depending on the ignore implementation, a
>> negative-match regexp may or may not work as the user expects. It
>> might require collapsing some or all ignore rules into a big ugly
>> alternate-list regexp. If the ignore engine already compiles the
>> rules into a big regexp, a negative matcher might be ok.
>>
>> In any event, I plan on starting by hacking out some (failing)
>> exclusion tests and will use that time to see if a negative-match
>> regexp approach will indeed work.
>>
>> -- John
>
> We turn globs into regexps and then put them all together in one big
> match. Except it turned out that python's matcher had a limit of
> something like 100 groups, so we limit it to 50 groups at a time.
>
> Unfortunately this probably means that it will work for almost everyone,
> except when it starts failing unpredictably...
I can't seem to make a negative match work in an ignore rule:
nmb at guttle[/tmp]$ bzr init test
Created a standalone tree (format: 2a)
nmb at guttle[/tmp]$ cd test
nmb at guttle[/tmp/test]$ touch file.txt file.a
nmb at guttle[/tmp/test]$ bzr st
unknown:
file.txt
nmb at guttle[/tmp/test]$ bzr ignored
file.a *.a
nmb at guttle[/tmp/test]$ bzr ignore 'RE:(?!.*\.a$)'
nmb at guttle[/tmp/test]$ bzr ignored
file.a *.a
nmb at guttle[/tmp/test]$ bzr st
added:
.bzrignore
unknown:
file.txt
nmb at guttle[/tmp/test]$ cat .bzrignore
RE:(?!.*\.a$)
I haven't tracked back to what regexp gets built for ignoring, but it
doesn't seem to include my negative match.
-Neil
More information about the bazaar
mailing list