[PATCH] Allowing multiple project-specific .hgignore files

Stuart kevinvisac at gmail.com
Sun Apr 29 23:24:26 CDT 2007


On Sun, 2007-04-29 at 23:03 -0500, Matt Mackall wrote:
> On Sun, Apr 29, 2007 at 11:00:46PM -0500, Matt Mackall wrote:
> > On Mon, Apr 30, 2007 at 12:26:08PM +1000, Stuart wrote:
> > > On Sun, 2007-04-29 at 21:05 -0500, Matt Mackall wrote:
> > > > [reply-to set to mercurial-devel, where such things go now]
> > > > 
> > > > On Mon, Apr 30, 2007 at 10:43:28AM +1000, Stuart wrote:
> > > > > Hey,
> > > > > 
> > > > > I've created a patch which allows .hgignore to be either a file (in the
> > > > > current style) or a directory containing multiple files, all of which
> > > > > are parsed for ignore patterns.
> > > > 
> > > > That's kind of neat.
> > > > 
> > > > It could also be done by adding an include: syntax to .hgignore, which
> > > > might be more flexible and simpler?
> > > 
> > > *** I don't think it would be simpler, but it might be slightly more
> > > flexible.
> > > 
> > > You could certainly accomplish the same functionality using includes
> > > (but only if they failed silently). It's probably not as tidy, however.
> > > If I want to maintain local ignore rules (in a repo where the .hgignore
> > > file is committed), I have to add an include: directive to bring them
> > > in.  Then, after I commit and push, everyone's repos will be polluted by
> > > an include: directive that is relevant only to me.
> > 
> > Good points.
> > 
> > Let's explore some other possibilities.
> > 
> > We could have an .hgignore.d/ (no need to move a current .hgignore)
> > We could have a .hg/localignore (unmanaged)
> > We could have include: lines
> > We could have .hgignore-*
> > 
> > I don't really see a use case for more than two .hgignore files (local
> > and managed), so unless you can think of a good one, .hg/localignore seems
> > the simplest. Then you don't need an extra ignore rule to ignore it
> > and it's a good match for .hgtags|.hg/localtags.
> 
> Also, it's worth noting that we can already do this in .hg/hgrc:
> 
> [ui]
> ignore = localignore
> 
> I'm not sure what path you'll actually get with that though.

*** Even if we can do this in .hg/hgrc already, I like the explicit
nature of .hg/localignore

It gets my vote for best solution.

If everyone agrees, I'll make a patch.

Stuart



More information about the Mercurial mailing list