Ignore symbolic links?

Matt Mackall mpm at selenic.com
Mon May 5 12:59:13 CDT 2008


On Mon, 2008-05-05 at 09:32 -0500, Pat Kane wrote:
> On Thu, May 1, 2008 at 3:08 PM, Pat Kane <pekane52 at gmail.com> wrote:
>  > ... I could always just do:  find -type l  >> .hgignore
> 
> That command added 3000 symbolic link names to the .hgignore
> file, which does help weed out the noise from an "hg status"
> command.  However, hg is now very slow:
> 
>   $ mv .hgignore hgignore
>   $ time hg status > o1
> 
>   real    0m1.877s
>   user    0m1.540s
>   sys     0m0.294s
> 
>   $ mv hgignore .hgignore
>   $ time hg status > o2
> 
>   real    0m21.183s
>   user    0m20.978s
>   sys     0m0.197s

Ignore patterns are O(n). So you're now effectively doing 3000 compares
against all the filenames in your repo. That's going to be slow.

You can make it smarter/faster by doing common stem combining. Change:

 a/b
 a/c
 a/d

to:

 a/(b|c|d)

This can be done recursively. I've done this manually on a few ugly
examples people have posted and basically made the ignore cost vanish.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list