{"thread":{"id":"31708","subject":"[ENHANCEMENT] Allow '**' pattern in .gitignore","startedAt":"2012-10-02T07:21:49Z","lastAt":"2012-10-04T01:34:02Z","messageCount":9,"participants":["Ramkumar Ramachandra","Stefano Lattarini","Nguyen Thai Ngoc Duy","Jens Lehmann","Joshua Jensen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200309","messageId":"CALkWK0nXfeAnFfdFtdDNdEwtk0mMPtpYbg8sPzfrEXUpXsGQOA@mail.gmail.com","threadId":"31708","inReplyTo":null,"subject":"[ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-10-02T07:21:49Z","receivedAt":"2012-10-02T07:21:49Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nI've often found the '**' (extended) shell glob useful for matching\nany string crossing directory boundaries: it's especially useful if\nyou only have a toplevel .gitignore, as opposed to a per-directory\n.gitignore.  Unfortunately, .gitignore currently uses fnmatch(3), and\ndoesn't recognize '**'.  Would extending the .gitignore format to\naccept this be a useful feature?  Would it involve re-implementing and\nextending fnmatch, or is there some other way?\n\nRam\n"},{"id":"200313","messageId":"506A9EA6.9010303@gmail.com","threadId":"31708","inReplyTo":"CALkWK0nXfeAnFfdFtdDNdEwtk0mMPtpYbg8sPzfrEXUpXsGQOA@mail.gmail.com","subject":"Re: [ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-10-02T07:58:30Z","receivedAt":"2012-10-02T07:58:30Z","isPatch":false,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote:\n> Hi,\n> \n> I've often found the '**' (extended) shell glob useful for matching\n> any string crossing directory boundaries: it's especially useful if\n> you only have a toplevel .gitignore, as opposed to a per-directory\n> .gitignore.  Unfortunately, .gitignore currently uses fnmatch(3), and\n> doesn't recognize '**'.  Would extending the .gitignore format to\n> accept this be a useful feature?  Would it involve re-implementing and\n> extending fnmatch, or is there some other way?\n>\nI think there is a topic in flight about this:\n\n    <http://thread.gmane.org/gmane.comp.version-control.git/206406>\n\nHTH,\n  Stefano\n"},{"id":"200315","messageId":"CALkWK0=X5nJ6Shwa0+6Jk2cgvvo25j=mKLRs4v=eQY7x9+XvFw@mail.gmail.com","threadId":"31708","inReplyTo":"506A9EA6.9010303@gmail.com","subject":"Re: [ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-10-02T08:24:42Z","receivedAt":"2012-10-02T08:24:42Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Stefano Lattarini wrote:\n> On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote:\n>> Hi,\n>>\n>> I've often found the '**' (extended) shell glob useful for matching\n>> any string crossing directory boundaries: it's especially useful if\n>> you only have a toplevel .gitignore, as opposed to a per-directory\n>> .gitignore.  Unfortunately, .gitignore currently uses fnmatch(3), and\n>> doesn't recognize '**'.  Would extending the .gitignore format to\n>> accept this be a useful feature?  Would it involve re-implementing and\n>> extending fnmatch, or is there some other way?\n>>\n> I think there is a topic in flight about this:\n>\n>     <http://thread.gmane.org/gmane.comp.version-control.git/206406>\n\nAh, yes.  Thanks.\n\nRam\n"},{"id":"200402","messageId":"CACsJy8CUK0g4FhuJxzJqN7qS2apoO2zYdg_SGvWzEN5dGcHhaA@mail.gmail.com","threadId":"31708","inReplyTo":"CALkWK0=X5nJ6Shwa0+6Jk2cgvvo25j=mKLRs4v=eQY7x9+XvFw@mail.gmail.com","subject":"Re: [ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-03T11:35:15Z","receivedAt":"2012-10-03T11:35:15Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Oct 2, 2012 at 3:24 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> Stefano Lattarini wrote:\n>> On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote:\n>>> Hi,\n>>>\n>>> I've often found the '**' (extended) shell glob useful for matching\n>>> any string crossing directory boundaries: it's especially useful if\n>>> you only have a toplevel .gitignore, as opposed to a per-directory\n>>> .gitignore.  Unfortunately, .gitignore currently uses fnmatch(3), and\n>>> doesn't recognize '**'.  Would extending the .gitignore format to\n>>> accept this be a useful feature?  Would it involve re-implementing and\n>>> extending fnmatch, or is there some other way?\n>>>\n>> I think there is a topic in flight about this:\n>>\n>>     <http://thread.gmane.org/gmane.comp.version-control.git/206406>\n\nWhile I'm behind this series, I have no use cases for it in my\nrepositories. It's tested in git test suite but that's about it. Some\nfeedback would be nice, especially on the performance side if you do a\nlot of ignores.\n-- \nDuy\n"},{"id":"200414","messageId":"506C3F23.9000009@web.de","threadId":"31708","inReplyTo":"CACsJy8CUK0g4FhuJxzJqN7qS2apoO2zYdg_SGvWzEN5dGcHhaA@mail.gmail.com","subject":"Re: [ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-10-03T13:35:31Z","receivedAt":"2012-10-03T13:35:31Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 03.10.2012 13:35, schrieb Nguyen Thai Ngoc Duy:\n> On Tue, Oct 2, 2012 at 3:24 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n>> Stefano Lattarini wrote:\n>>> On 10/02/2012 09:21 AM, Ramkumar Ramachandra wrote:\n>>>> Hi,\n>>>>\n>>>> I've often found the '**' (extended) shell glob useful for matching\n>>>> any string crossing directory boundaries: it's especially useful if\n>>>> you only have a toplevel .gitignore, as opposed to a per-directory\n>>>> .gitignore.  Unfortunately, .gitignore currently uses fnmatch(3), and\n>>>> doesn't recognize '**'.  Would extending the .gitignore format to\n>>>> accept this be a useful feature?  Would it involve re-implementing and\n>>>> extending fnmatch, or is there some other way?\n>>>>\n>>> I think there is a topic in flight about this:\n>>>\n>>>     <http://thread.gmane.org/gmane.comp.version-control.git/206406>\n> \n> While I'm behind this series, I have no use cases for it in my\n> repositories. It's tested in git test suite but that's about it. Some\n> feedback would be nice, especially on the performance side if you do a\n> lot of ignores.\n\nI really like it as we do have use cases at my dayjob. Due to our\nnaming conventions in subdirectories we have stuff like this in our\n.gitignore files:\n\n*/foo/bar\n*/*/foo/bar\n*/*/*/foo/bar\n\nUsing \"**/foo/bar\" instead would be a great improvement (I looked\ninto adding that myself some time ago, but decided it wasn't a low\nhanging fruit).\n\nMaybe I'll find time do do some performance measurements until the\nweekend, what numbers are you interested in? Will a hot cache \"time\ngit status\" be sufficient or are you interested in other numbers too?\n"},{"id":"200415","messageId":"CACsJy8DRxbjcRpbO30vOCo9D+TK_dDX_oiocZSOtnGAR2jAOFw@mail.gmail.com","threadId":"31708","inReplyTo":"506C3F23.9000009@web.de","subject":"Re: [ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-03T13:42:29Z","receivedAt":"2012-10-03T13:42:29Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Oct 3, 2012 at 8:35 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> */foo/bar\n> */*/foo/bar\n> */*/*/foo/bar\n>\n> Using \"**/foo/bar\" instead would be a great improvement\n\nIf this \"**/foo/bar\" (i.e. no wildcards except one ** at the\nbeginning) is popular, we could optimize this case, turning fmatch()\ninto strncmp(), just like what we do for \"foobar*\"\n-- \nDuy\n"},{"id":"200418","messageId":"506C42CB.90903@web.de","threadId":"31708","inReplyTo":"CACsJy8DRxbjcRpbO30vOCo9D+TK_dDX_oiocZSOtnGAR2jAOFw@mail.gmail.com","subject":"Re: [ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-10-03T13:51:07Z","receivedAt":"2012-10-03T13:51:07Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 03.10.2012 15:42, schrieb Nguyen Thai Ngoc Duy:\n> On Wed, Oct 3, 2012 at 8:35 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>> */foo/bar\n>> */*/foo/bar\n>> */*/*/foo/bar\n>>\n>> Using \"**/foo/bar\" instead would be a great improvement\n> \n> If this \"**/foo/bar\" (i.e. no wildcards except one ** at the\n> beginning) is popular, we could optimize this case, turning fmatch()\n> into strncmp(), just like what we do for \"foobar*\"\n\nI expect the logic \"ignore <pattern including a slash> in any\ndirectory depth you find it\" to be one of the major use cases for\n\"**\", so I think optimization makes sense here.\n"},{"id":"200437","messageId":"506C7B37.3080804@workspacewhiz.com","threadId":"31708","inReplyTo":"CACsJy8DRxbjcRpbO30vOCo9D+TK_dDX_oiocZSOtnGAR2jAOFw@mail.gmail.com","subject":"Re: [ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Joshua Jensen","fromEmail":"jjensen@workspacewhiz.com","sentAt":"2012-10-03T17:51:51Z","receivedAt":"2012-10-03T17:51:51Z","isPatch":false,"sender":{"key":"jjensen@workspacewhiz.com","avatar":"https://avatars.githubusercontent.com/u/111687?v=4"},"body":"----- Original Message -----\nFrom: Nguyen Thai Ngoc Duy\nDate: 10/3/2012 7:42 AM\n> On Wed, Oct 3, 2012 at 8:35 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>> */foo/bar\n>> */*/foo/bar\n>> */*/*/foo/bar\n>>\n>> Using \"**/foo/bar\" instead would be a great improvement\n> If this \"**/foo/bar\" (i.e. no wildcards except one ** at the\n> beginning) is popular, we could optimize this case, turning fmatch()\n> into strncmp(), just like what we do for \"foobar*\"\nFWIW, I would like to see this in .gitattributes as well.  I have a \nversion of .gitattributes that supports recursive wildcards that I use \nfor specifying filters.\n\n-Josh\n"},{"id":"200465","messageId":"CACsJy8C2QcNPte+C9aFHOD1oTqopqdX2=6KG13s4dPrPoONYVg@mail.gmail.com","threadId":"31708","inReplyTo":"506C7B37.3080804@workspacewhiz.com","subject":"Re: [ENHANCEMENT] Allow '**' pattern in .gitignore","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-04T01:34:02Z","receivedAt":"2012-10-04T01:34:02Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Oct 4, 2012 at 12:51 AM, Joshua Jensen\n<jjensen@workspacewhiz.com> wrote:\n> FWIW, I would like to see this in .gitattributes as well.  I have a version\n> of .gitattributes that supports recursive wildcards that I use for\n> specifying filters.\n\n.gitattributes also learns about \"**\" in nd/wildmatch topic.\n-- \nDuy\n"}]}