Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use rooted glob patterns in .hgignore?

I prefer to use glob syntax in my .hgignore files, but now I need to create a rooted pattern. I want to ignore my /static directory, but not /assets/static. The line

static/

ignores both. Is there a way to do rooted glob patterns? If not, I can switch to regex, but glob just seems so much more natural for matching pathnames.

like image 701
Roy Smith Avatar asked May 20 '12 13:05

Roy Smith


1 Answers

You cannot root your glob patterns — this is documented in the manpage. You can, however, switch back and forth between the glob and regexp syntax:

syntax: glob
*.pyc

syntax: regexp
^static/

syntax: glob
*~
like image 121
Martin Geisler Avatar answered Sep 28 '22 16:09

Martin Geisler