From: James Pickens Date: Fri, 30 Oct 2009 21:52:07 GMT Subject: Re: [PATCH] gitignore: root most patterns at the top-level directory Message-ID: <885649360910301452g7d7311d7w1133f5d4c98072dc@mail.gmail.com> In-Reply-To: <20091030182431.GA19901@coredump.intra.peff.net> On Fri, Oct 30, 2009 at 11:24 AM, Jeff King wrote: >> If we do so, there is no need to change the current .gitignore entires. >> You need to spell a concrete filename as a glob pattern that matches only >> one path if you want the recursive behaviour. E.g. if you have a Makefile >> per subdirectory, each of which generates and includes Makefile.depend >> file, you would write "Makefile.depen[d]" in the toplevel .gitignore file. > > While clever, that use of '[d]' seems unneccessarily obscure to me. Why > not just give a wildcard for "any subdirectory of me" and do: > > Makefile.depend > **/Makefile.depend > > Since "**" is in common use in other systems, it's pretty clear (to me, > anyway, but then I am the one suggesting the syntax ;) ) what that > means. +1 to that. I've often wished for Git to support the ** wildcard, not only in .gitignore but also in other places like .gitattributes and sparse checkout (if that feature ever gets completed anyways). It's on my list of "git features I would work on if I ever had any free time." James