[patch] syntax:plain for .hgignore
Guido Ostkamp
hg at ostkamp.fastmail.fm
Fri Sep 14 16:31:18 CDT 2007
On Fri, 14 Sep 2007, Jonathan S. Shapiro wrote:
> This makes a sad sort of sense, and it suggests two things that we might
> want to consider:
>
> 1. Document this somewhere as an advisory hint.
> 2. Consider an anchor syntax for globs if we don't already have one.
>
> Offhand, it seems to me that a glob pattern starting with / can be
> considered anchored.
Looks like a good idea to me.
> Failing that, we could augment the glob syntax by permitting a leading ^
> to indicate an anchor.
This character is a valid character in filenames, at least under Unix, so
you can't use it for special purposes except when you allow some kind of
escaping.
> In either case, we should be sure to document the behavior someplace if
> that is not already done.
>
> Other thoughts?
I've asked Matt why 'match' is used instead of 'search' as I had expected.
His answer was this:
"The matching engine supports both rooted and unrooted regexes and
globs."
However, IMHO you could easily use 'search' to implement 'rooted' regexes
by including the prefix '^' for these cases. For all other cases, you
would save the '.*' that currently gets in the way and seems to lead to
the performance loss.
Regards
Guido
More information about the Mercurial-devel
mailing list