Glob patterns and .hgignore

Martin Geisler mg at lazybytes.net
Thu Dec 15 02:55:07 CST 2011


Hi everybody,

Yesterday, a guy asked how he could add files matching various patterns
and I proposed putting the patterns in a file and use

  hg add listfile:patterns.txt

See http://unix.stackexchange.com/a/26817/13300 for details. However, it
turns out that the patterns respect the .hgignore file.

I expected that

  hg add "glob:*.jpg"

would add x.jpg, even if ignored. On the other hand, I would not expect

  hg add -I "glob:*.jpg"

to add it -- that seems like the useful distinction between a direct
filename and the -I flag. Looking at the code, I see that this is not at
all how matching behave... :)

Is anybody else confused by this?

Does anybody use the -I flag? I never use it since I can specify the
files I want as the main argument 'hg add', 'hg remove', etc.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial/attachments/20111215/3f4723c4/attachment.pgp>


More information about the Mercurial mailing list