{"thread":{"id":"25451","subject":"Exlude files from git log -p","startedAt":"2010-10-14T20:06:26Z","lastAt":"2010-10-15T00:54:57Z","messageCount":2,"participants":["Maaartin","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"153534","messageId":"loom.20101014T214508-466@post.gmane.org","threadId":"25451","inReplyTo":null,"subject":"Exlude files from git log -p","fromName":"Maaartin","fromEmail":"grajcar1@seznam.cz","sentAt":"2010-10-14T20:06:26Z","receivedAt":"2010-10-14T20:06:26Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"Is it possible to exclude a couple of files from the output generated by \"git \nlog -p\"? Enumerating all other files/dirs is not an option for me.\n\nBackground: Some files in my repo are generated source code and often contain \nquite a lot of changes. Their generation can't be done in a fully automatic \nfashion and it happens that it gets forgotten; that's why I need to version them \nas well.\n\nI'm thinking about marking them as binary, this should remove their lines from \nthe output, but it would make their comparison impossible (at least AFAIK).\n"},{"id":"153553","messageId":"20101015005457.GA13334@sigill.intra.peff.net","threadId":"25451","inReplyTo":"loom.20101014T214508-466@post.gmane.org","subject":"Re: Exlude files from git log -p","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-10-15T00:54:57Z","receivedAt":"2010-10-15T00:54:57Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 14, 2010 at 08:06:26PM +0000, Maaartin wrote:\n\n> Is it possible to exclude a couple of files from the output generated by \"git \n> log -p\"? Enumerating all other files/dirs is not an option for me.\n\nNot directly. Excluding files from diffs is something that is sometimes\nrequested, but nobody has implemented it yet.\n\nBut...\n\n> Background: Some files in my repo are generated source code and often contain \n> quite a lot of changes. Their generation can't be done in a fully automatic \n> fashion and it happens that it gets forgotten; that's why I need to version them \n> as well.\n> \n> I'm thinking about marking them as binary, this should remove their lines from \n> the output, but it would make their comparison impossible (at least AFAIK).\n\nFor a situation like this, where you almost always want them ignored,\nyou can mark them with a special diff driver in .gitattributes. And then\nyou can either use a null textconv for that driver (which will give you\na diff header when they change, but the contents of the diff will always\nbe empty), or you can write a custom external diff (in which case you\ncan remove them from the output entirely).\n\nWhen you wanted to see them, you could just tweak the config (which\nmakes it really not that much different than marking them as binary), or\nif you wanted to get fancy, your custom external diff could look at some\nenvironment variable, allowing you to do:\n\n  git log -p ;# custom diff ignores certain files\n  DIFF_INVISIBLE=1 git log -p ;# show all\n\nor something like that.\n\n-Peff\n"}]}