{"thread":{"id":"26177","subject":"gitattributes don't work","startedAt":"2011-01-03T00:42:08Z","lastAt":"2011-01-04T18:33:14Z","messageCount":5,"participants":["Marcin Wiśnicki","Jonathan Nieder","Nguyen Thai Ngoc Duy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158826","messageId":"ifr610$3kl$1@dough.gmane.org","threadId":"26177","inReplyTo":null,"subject":"gitattributes don't work","fromName":"Marcin Wiśnicki","fromEmail":"mwisnicki@gmail.com","sentAt":"2011-01-03T00:42:08Z","receivedAt":"2011-01-03T00:42:08Z","isPatch":false,"sender":{"key":"mwisnicki@gmail.com","avatar":"https://gravatar.com/avatar/6bc6cce46e549217fe39b05ac03acb4f5755154d6752ff65b580783365ad3e50?d=mp&s=160"},"body":"I'm trying to exclude certain paths (those that contain \"xmac/gen/\") from \ndiff output using .git/info/attributes (not .gitattributes).\n\nAccording to gitattributes(5) it supports patterns from gitignore(5).\n\nExample path that must be excluded:\nsrc/byucc/jhdl/CSRC/xmac/gen/and2_dp_g.xmac\n\nWhat I've tried but didn't work:\nxmac/gen/ -diff\n\nFollowing works but is not what I want:\n*.xmac -diff\n\nIt seems I can only get it to work for file names but not for whole paths.\nWhat am I doing wrong or is this a bug ?\n\ngit version 1.7.3.4\n"},{"id":"158832","messageId":"20110103011113.GF30506@burratino","threadId":"26177","inReplyTo":"ifr610$3kl$1@dough.gmane.org","subject":"Re: gitattributes don't work","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-01-03T01:11:13Z","receivedAt":"2011-01-03T01:11:13Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Marcin Wiśnicki wrote:\n\n> I'm trying to exclude certain paths (those that contain \"xmac/gen/\") from \n> diff output using .git/info/attributes (not .gitattributes).\n\nTricky.  Have you tried\n\n xmac?gen? -diff\n\n?  You might also be interested in the nd/struct-pathspec branch:\n\n git clone git://repo.or.cz/git.git\n cd git\n git log --grep=nd/struct-pathspec\n\nfor some work and explanation on patterns used to specify paths.\n\nRegards,\nJonathan\n"},{"id":"158839","messageId":"AANLkTikbGQkREQAx0p6Q+DrXPP2zWDU7doOO6yg+NGeC@mail.gmail.com","threadId":"26177","inReplyTo":"ifr610$3kl$1@dough.gmane.org","subject":"Re: gitattributes don't work","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-01-03T04:34:00Z","receivedAt":"2011-01-03T04:34:00Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"2011/1/3 Marcin Wiśnicki <mwisnicki@gmail.com>:\n> I'm trying to exclude certain paths (those that contain \"xmac/gen/\") from\n> diff output using .git/info/attributes (not .gitattributes).\n>\n> According to gitattributes(5) it supports patterns from gitignore(5).\n>\n> Example path that must be excluded:\n> src/byucc/jhdl/CSRC/xmac/gen/and2_dp_g.xmac\n>\n> What I've tried but didn't work:\n> xmac/gen/ -diff\n>\n> Following works but is not what I want:\n> *.xmac -diff\n>\n> It seems I can only get it to work for file names but not for whole paths.\n> What am I doing wrong or is this a bug ?\n\nWhile gitattributes(5) says that, actually gitattributes and gitignore\nuse different matching implementations. gitattributes one seems\nunchanged since its introduction in d0bfd02 (Add basic infrastructure\nto assign attributes to paths - 2007-04-12). gitignore on the other\nhand learned foo/ pattern later in d6b8fc3 (gitignore(5): Allow \"foo/\"\nin ignore list to match directory \"foo\" - 2008-01-31).\n\nYeah, it looks like a bug to me. A better way to solve this once and\nfor all, is to unify the two implementations (which is good for\ngitattr because there have been optimizations added to gitignore). I\ntried long ago and gave up. Something to do with the order of matching\n(gitignore tries inner directories first, while gitattr starts from\nouter ones).\n\nFor the time being, anyone who changes gitignore should be reminded to\nconsider whether it's applicable to gitattributes and vice versa.\n\nWhich reminds me, Joshua, maybe you should add case-insensitive\nsupport to gitattributes too ;-)\n-- \nDuy\n"},{"id":"158866","messageId":"iftvu6$m97$1@dough.gmane.org","threadId":"26177","inReplyTo":"AANLkTikbGQkREQAx0p6Q+DrXPP2zWDU7doOO6yg+NGeC@mail.gmail.com","subject":"Re: gitattributes don't work","fromName":"Marcin Wiśnicki","fromEmail":"mwisnicki@gmail.com","sentAt":"2011-01-04T02:16:38Z","receivedAt":"2011-01-04T02:16:38Z","isPatch":false,"sender":{"key":"mwisnicki@gmail.com","avatar":"https://gravatar.com/avatar/6bc6cce46e549217fe39b05ac03acb4f5755154d6752ff65b580783365ad3e50?d=mp&s=160"},"body":"On Mon, 03 Jan 2011 11:34:00 +0700, Nguyen Thai Ngoc Duy wrote:\n\n> 2011/1/3 Marcin Wiśnicki <mwisnicki@gmail.com>:\n>>\n>> According to gitattributes(5) it supports patterns from gitignore(5).\n> \n> While gitattributes(5) says that, actually gitattributes and gitignore\n> [snip]\n> Yeah, it looks like a bug to me. A better way to solve this once and for\n> [snip]\n> For the time being, anyone who changes gitignore should be reminded to\n> consider whether it's applicable to gitattributes and vice versa.\n\nI think that for the time being at least the manual page must change to \nreflect reality.\n"},{"id":"158900","messageId":"7vbp3wh639.fsf@alter.siamese.dyndns.org","threadId":"26177","inReplyTo":"ifr610$3kl$1@dough.gmane.org","subject":"Re: gitattributes don't work","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-04T18:33:14Z","receivedAt":"2011-01-04T18:33:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marcin Wiśnicki <mwisnicki@gmail.com> writes:\n\n> I'm trying to exclude certain paths (those that contain \"xmac/gen/\") from \n> diff output using .git/info/attributes (not .gitattributes).\n>\n> According to gitattributes(5) it supports patterns from gitignore(5).\n>\n> Example path that must be excluded:\n> src/byucc/jhdl/CSRC/xmac/gen/and2_dp_g.xmac\n>\n> What I've tried but didn't work:\n> xmac/gen/ -diff\n\nWhy not \"xmac/gen/* -diff\" or even \"xmac/gen/*.xmac -diff\"?\n"}]}