Re: [ENHANCEMENT] Allow '**' pattern in .gitignore
- From
Jens Lehmann <jens.lehmann@web.de>
- Date
- Oct 3, 2012, 13:35 UTC
- Message-ID
- <506C3F23.9000009@web.de>
- In-Reply-To
- <CACsJy8CUK0g4FhuJxzJqN7qS2apoO2zYdg_SGvWzEN5dGcHhaA@mail.gmail.com>
Am 03.10.2012 13:35, schrieb Nguyen Thai Ngoc Duy:
Show 21 quoted lines
> On Tue, Oct 2, 2012 at 3:24 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote: >> Stefano Lattarini wrote: >>> On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote: >>>> Hi, >>>> >>>> I've often found the '**' (extended) shell glob useful for matching >>>> any string crossing directory boundaries: it's especially useful if >>>> you only have a toplevel .gitignore, as opposed to a per-directory >>>> .gitignore. Unfortunately, .gitignore currently uses fnmatch(3), and >>>> doesn't recognize '**'. Would extending the .gitignore format to >>>> accept this be a useful feature? Would it involve re-implementing and >>>> extending fnmatch, or is there some other way? >>>> >>> I think there is a topic in flight about this: >>> >>> <http://thread.gmane.org/gmane.comp.version-control.git/206406> > > While I'm behind this series, I have no use cases for it in my > repositories. It's tested in git test suite but that's about it. Some > feedback would be nice, especially on the performance side if you do a > lot of ignores.
I really like it as we do have use cases at my dayjob. Due to our naming conventions in subdirectories we have stuff like this in our .gitignore files:
*/foo/bar */*/foo/bar */*/*/foo/bar
Using "**/foo/bar" instead would be a great improvement (I looked into adding that myself some time ago, but decided it wasn't a low hanging fruit).
Maybe I'll find time do do some performance measurements until the weekend, what numbers are you interested in? Will a hot cache "time git status" be sufficient or are you interested in other numbers too?