Skip to content
Snippets Groups Projects
Commit 4fab8a7d authored by Valentin Gatien-Baron's avatar Valentin Gatien-Baron
Browse files

match: support rooted globs in hgignore

In a .hgignore, "glob:foo" always means "**/foo". This cannot be
avoided because there is no syntax like "^" in regexes to say you
don't want the implied "**/" (of course one can use regexes, but glob
syntax is nice).

When you have a long list of fairly specific globs like
path/to/some/thing, this has two consequences:
1. unintended files may be ignored (not too common though)
2. matching performance can suffer significantly
  Here is vanilla hg status timing on a private repository:

  Using syntax:glob everywhere
  real	0m2.199s
  user	0m1.545s
  sys	0m0.619s

  When rooting the appropriate globs
  real	0m1.434s
  user	0m0.847s
  sys	0m0.565s

  (tangentially, none of this shows up in --profile's output. It
   seems that C code doesn't play well with profiling)

The code already supports this but there is no syntax to make use of
it, so it seems reasonable to create such syntax. I create a new
hgignore syntax "rootglob".

Differential Revision: https://phab.mercurial-scm.org/D5493
parent 183df3df
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment