Re: [PROPOSAL] .gitignore syntax modification
From: Kevin Ballard <hidden>
Date: 2016-06-15 22:49:46
On Oct 12, 2010, at 7:40 PM, Jonathan Nieder wrote:
Kevin Ballard wrote:quoted
On Oct 12, 2010, at 7:24 PM, Nguyen Thai Ngoc Duy wrote:quoted
quoted
Special case "**/" (also "path/to/**/") is probably good enough. You might need to handle all combinations of "**/" and other optimizations in excluded_from_list() though. Can you make a patch (or a few patches) for it?[...]quoted
At this point I'm actually in favor of simply assuming all paths that don't start with / can be matched at any levelAs a long-term change with early warnings and proper deprecation procedure that may (or may not) be an ok idea, but in the short term it is certainly a no-go. If linux-2.6 is any indication of what to expect, some projects are not using / in front of any paths with / at all.
Another possibility is using this new behavior for core.excludesfile and possibly .git/info/exclude, but not for patterns in .gitignore files. The benefit here is any existing project that uses .gitignore files will be unchanged, but global (and possibly repo-wide) patterns can benefit from the new behavior. The drawback is this would introduce a behavioral difference for patterns depending on which file they're in, which is probably not acceptable. I will look into how much work is required to support **/ patterns without doing a wholesale replacement of fnmatch(). Hopefully it won't be infeasible. -Kevin Ballard