[patch] improved ignore pattern matching (#57637)

Kent Gibson warthog618 at gmail.com
Mon Nov 27 23:36:52 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



John Arbash Meinel wrote:
>
> Well, it will also match 'foobar/CVS'. The way it is written, it seems
> like '**/' should match either nothing, or something that ends in a
> directory separator, which sounds like a good match for (.+/)?
>
> I also prefer (.+/)? to (|.+/). As an aside, these should probably all
> be (?:) style, which uses a group that can't be referenced later, which
> can save processing overhead. (And the fact that the python regex engine
> has a hard limit on the number of groups it can handle per regex).
>
In the implementation I do use the (?:) form - I omitted it here so as
to not confuse the discussion.
Btw, unnumbered groups are no faster than named/numbered, according to
the Python re documentation, and from experience that seems to be the
case.
The reason we use (?:) is so the internals of the pattern wont
conflict with the aggregation into a single regex and the mapping back
to globs, not for performance.

Cheers,
Kent.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFa3aTgoxTFTi1P8QRApcpAJwILkvk6R/OR6nDcKlc/GPzruPvWgCeISyM
k5fkhPAqjZbJsMi7tdPaDuQ=
=weC/
-----END PGP SIGNATURE-----




More information about the bazaar mailing list