[patch] improved ignore pattern matching (#57637)

Jari Aalto jari.aalto at cante.net
Sun Nov 26 18:34:16 GMT 2006


Kent Gibson <warthog618 at gmail.com> writes:

> Jari Aalto wrote:
> >
> > Just a comment
> >
> > - Standard shell patterns are fine (no extensions needed) - 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
> >
> The patch does almost exactly what you suggest (option b - line by line).
> Except the 'magic'  word  is  'RE:', not 'regex::'.

Hm. May I suggest using "regex::". The motivation:

- Bzr has taken methodology to present actions in full, like
  "--recurse", "status", "--dry--run". 

Spelling out the intention is in my opinion very good and shortened
"RE:", does not, (although commonly used), fit to the previous
methodology.

If "RE:" is a shorthand to "regex::", then this is different.
 
> > Whitespace should not be allowed in regexp lines, but the some
> > regexp-shortcut to substitute it. Like Perl's well known \s.
> >
> Not supporting whitespace in regexes would be weird.  In regexes
> whitespace is normally matched verbatim - if that's how you want to
> use it.  Or you can use the special character groups as you suggest.
> Leave it to the user.

Sure, I was just think that someone wrotes:

    <SPACE><TAB>

and the other person loads that to editor, which converts it to
following upon save:

    <SPACE><N spaces>

Provided that the editor has setting "always store files without tabs,
using spaces only".

Forcing people to use \s always will prevent mistakes like these at
the source. It is also hard to see "live" what character are there:

    <SPACE><TAB>: perceived as? <SPACE><N spaces> or <TAB><SPACE> or ...

Practically unvisible unless you turn on some magical "show tabs"
mode.

> The patch supports all Python regex formats, with the exclusion of
> named/numbered grouping, so it will happily interpret \s as
> whitespace, \S as non-whitespace, \d as digits etc.

Good. Good.

Thank you,
Jari





More information about the bazaar mailing list