From: Maaartin Date: Mon, 11 Oct 2010 23:46:28 GMT Subject: Re: [PROPOSAL] .gitignore syntax modification Message-ID: In-Reply-To: Kevin Ballard sb.org> writes: > On Oct 8, 2010, at 2:58 PM, Maaartin wrote: > That's not the right layout. I'd have to do > > *.xcodeproj/* > !*.xcodeproj/project.pbxproj > */*.xcodeproj/* > !*/*.xcodeproj/project.pbxproj > > And so on, once for each possible level of nesting. Sorry, that's was I meant, I was too sloppy/tired/stupid when writing this. > ... The problem I'm talking about is > simply that you cannot write a pattern that includes a slash and have that pattern match at any nesting level. I see I wrong again. At least I learned something. > Upon further reflection, if we stick with platform-provided fnmatch() we don't have to special-case a > prefixed **/. We could simply define patterns as always matching in that way, and you can use the > already-existing prefixed / to root it at the current level. So if my pattern looks like > > *.xcodeproj/* > > Then it will attempt to match this pattern against the last 2 path components of any path rooted in this > directory. It can simply count the slashes to determine the number of path components. If I really want it > to just match *.xcodeproj files in the current directory then my pattern should look like > > /*.xcodeproj/* IMHO, this is how it should work, simple and consequent. Sorry for clobbering this thread by my mistakes.