[patch] improved ignore pattern matching (#57637)

Jari Aalto jari.aalto at cante.net
Mon Nov 27 19:35:38 GMT 2006


Kent Gibson <warthog618 at gmail.com> writes:

> Jari Aalto wrote:
> >> 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.
> >
> I agree that that scenario is possible, but I don't think hobbling the
> regexes is the solution.
> Given we are talking about filenames, I would expect the most common
> whitespace to be a single space between words.  I wouldn't want to
> force the user have to translate a space to '\s' for all those cases
> just to save the relative few that use '\t' in filenames from falling
> into the trap you describe.

Hm. What about a warnign when processing the ignore file:

  Warning: TAB-charecter found in ignore file. This is dangerouns and
  if you men it, you should probably use \t or \s.

I believe it's extremely rare to use TAB, so and warning should be in 
place.

Jari






More information about the bazaar mailing list