[patch] improved ignore pattern matching (#57637)
Jan Hudec
bulb at ucw.cz
Sun Nov 26 09:45:31 GMT 2006
On Sun, Nov 26, 2006 at 11:22:13AM +0200, Jari Aalto wrote:
> Kent Gibson <warthog618 at gmail.com> writes:
>
> > >
> > Further, I mailed to the list several weeks ago regarding what style
> > extension styles people would prefer.
> > Still not one reply. You could take that to mean no one is interested
> > in having those extensions added at all.
> >
> [...]
> > I think there has to be a point at which you give up on maintaining
> > backwards compatibility cos it's just not worth it. Rather than
> > taking heroic measures to retain the existing ignore behaviour for old
> > installations it is better to clearly warn that there is a behavioural
> > change and be done with it. This is one of those cases.
>
> Just a comment
>
> - Standard shell patterns are fine (no extensions needed)
No, they are not. One extension -- the ** -- is needed. How would you
say 'all .o files under lib (wole subtree)' with standard shell
patterns? (Just a note -- in standard shell patterns * does NOT match /)
> - Regexp patterns would be great
>
> Being able to select between either of these a) globally) or b)
> line-by-line basis is all that I would need. Meaning, that bzr wold
> default to shell style and only if 'magic' word appears in front of
> lines, then the line would be treated as regexp:
>
> *.o
> regexp::some.*silly.*path
>
> Whitespace should not be allowed in regexp lines, but the some
> regexp-shortcut to substitute it. Like Perl's well known \s.
>
> About backwards comaptibility:
>
> - The ignore patterns file should have line "version: N" to tell
> to what bzr version they were created.
>
> if ! version
> complain and quit. Version tag must be there.
> "Ignore pattern files must contain version number. See manual ..."
This is backwards incompatible. Remember, that it's a normal versioned
file...
> else if ( version = bzr version now)
> continue
> else if ( version != bzr version now)
> Check if bzr internal patterns have had changes since. If they
> have, quit and print error: "Patterns have changed since bzr
> version XXX found in ignore file. Please update ignore file to
> current standard and update at the same time 'version' field to
> current bzr version which is YYY"
That's the exact reason why the specification talks about making them
properties -- this is extemely ugly.
--------------------------------------------------------------------------------
- Jan Hudec `Bulb' <bulb at ucw.cz>
More information about the bazaar
mailing list