Glob patterns and .hgignore

Scott Palmer swpalmer at gmail.com
Thu Dec 15 06:54:05 CST 2011


On 2011-12-15, at 3:55 AM, Martin Geisler wrote:

> 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

I'm confused already wouldn't the explicit -I on the command line override the .hgingnore file?
I think it could be the opposite of what you wrote above.

> -- that seems like the useful distinction between a direct
> filename and the -I flag.

But a pattern *.jpg is not really a direct filename is it?

> Is anybody else confused by this?

Yes.I am now that you brought it up. :-)


Scott


More information about the Mercurial mailing list