[PATCH] new command debugignore

Martin Geisler mg at lazybytes.net
Sun Jul 4 09:37:20 CDT 2010


Jason Harris <jason at jasonfharris.com> writes:

> On Jul 4, 2010, at 2:41 PM, Martin Geisler wrote:
>
>> Jason Harris <jason at jasonfharris.com> writes:
>> 
>> Hi Jason
>> 
>>> Here is the patch for adding the command debugignore. This is my
>>> second patch and my Mercurial coding foo is weak, and I am sure I have
>>> named something wrong, or put something in the wrong place, etc. Thus
>>> go easy on me with this patch :)
>>> 
>>> (I raised this with a few people on IRC#mercurial and they thought it
>>> was a good idea...)
>>> 
>>> Example syntax:
>>> 
>>> [Bolt:MacHgDev/MacHg/LocalMercurial/mercurial] MacHg 372(372) $ hg debugignore
>>> (?:^\.hg|^\.mq|.*.DS_Store|.*.Trash|.*\.xcodeproj/.*\.pbxuser|.*\.xcodeproj/.*\.mode1v3|(?:|.*/)status(?:/|$)|(?:|.*/)guards(?:/|$)|(?:|.*/)[^/]*\.mode1v3(?:/|$))
>>> 
>>> [Bolt:~] $ hg debugignore /Development/MacHgDev/MacHg/.hgignore
>>> (?:(?:|.*/)\.DS\_Store(?:/|$)|(?:|.*/)build(?:/|$))
>> 
>> Interesting and I guess this can be used to debug some cases where
>> people don't understand the regexp generated from their .hgignore files.
>> 
>> However, a more ambitious and interesting command would be one that
>> tells you exactly which line of which ignore file is responsible for
>> ignoring a particular file. Something that would allow me to do this:
>> 
>>  % hg debugignore foo/bar/x.c
>>  .hgignore:17 foo
>
> Ahh... I guess that would be useful for some people as well. However
> for my purposes I need something which implements what I added. But I
> can see that it might not be so useful to others... Would you want
> this current command with a different name or maybe you guys wouldn't
> want it in core Mercurial at all, and I will just leave it in my
> patched version which ships with MacHg (once I implement your
> suggestions...)

I think it should be an extension -- printing the big, ugly regexp seems
of little use as a core feature. You can then ship and enable the
extension by default in MacHg.

-- 
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-devel/attachments/20100704/a885dd91/attachment.pgp>


More information about the Mercurial-devel mailing list