[PATCH] Warn in case user tries to add files which would otherwise be ignored

Jesse Glick jesse.glick at sun.com
Sat Feb 23 13:31:21 CST 2008


Matt Mackall wrote:
>>> (But "hg add module/build/*" will still add things).
>>
>> Right, which can be observed in the test.
> 
> So is this patch really needed?

I don't know. I know in 0.9.5 people accidentally add build products and 
it is a mess to clean up. Perhaps b41f0d6a74fc will fix most such cases, 
but I doubt it will fix them all. Having a warning seems a lot safer.

> I'd prefer not to add it as there's a common "ignore everything but
> what's explicitly added" usage model.

Perhaps there should be a configuration option to disable the warning, 
for people working in repos using this model. Or is there some simple 
way to detect that such a model is being used? Does everyone using it 
just have a single entry

---%<--- .hgignore
glob:*
---%<---

or

---%<--- .hgignore
.*
---%<---

or

---%<--- .hgignore
.
---%<---

or something like this? I guess one simple solution would be to check if 
dirstate._dirignore('arbitrary'), and if so, guess that everything is 
being ignored and issue no warnings.



More information about the Mercurial-devel mailing list