{"thread":{"id":"23435","subject":"git diff/grep add --exclude option","startedAt":"2010-04-12T21:02:06Z","lastAt":"2010-04-15T20:25:30Z","messageCount":2,"participants":["Sylvain Rabot","Johannes Gilger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"139370","messageId":"1271106125.3031.31.camel@kheops","threadId":"23435","inReplyTo":null,"subject":"git diff/grep add --exclude option","fromName":"Sylvain Rabot","fromEmail":"sylvain@abstraction.fr","sentAt":"2010-04-12T21:02:06Z","receivedAt":"2010-04-12T21:02:06Z","isPatch":false,"sender":{"key":"sylvain@abstraction.fr","avatar":"https://avatars.githubusercontent.com/u/153052?v=4"},"body":"Hi,\n\nI was surprised to not find an option to exclude file from git diff/grep\noutputs like -x for diff or --exclude for grep. It's too bad because it\ncan be really useful.\n\nIs something like that is planned to be implemented by somebody? I would\nhave loved to do it but unfortunately I'm no C developer.\n\nRegards.\n\n-- \nSylvain Rabot <sylvain@abstraction.fr>\n"},{"id":"139624","messageId":"slrnhsetj6.esr.heipei@dualtron.heipei.net","threadId":"23435","inReplyTo":"1271106125.3031.31.camel@kheops","subject":"Re: git diff/grep add --exclude option","fromName":"Johannes Gilger","fromEmail":"heipei@hackvalue.de","sentAt":"2010-04-15T20:25:30Z","receivedAt":"2010-04-15T20:25:30Z","isPatch":false,"sender":{"key":"heipei@hackvalue.de","avatar":"https://avatars.githubusercontent.com/u/6072?v=4"},"body":"On 2010-04-12, Sylvain Rabot <sylvain@abstraction.fr> wrote:\n> I was surprised to not find an option to exclude file from git diff/grep\n> outputs like -x for diff or --exclude for grep. It's too bad because it\n> can be really useful.\n\nYeah, me too, but probably because I never needed it ;) Anyway, there\nwere some discussions on this before [1]. I thin a viable workaround is\nusing ls-files and grep. Quick example:\n\ngit diff -- $(git ls-files | grep -Ev \"(^Documentation|^compat/mingw.c)\")\n\nwould show everything except the whole Documentation subtree and mingw.c\nfrom compat. Now, you might even whip that into your very own\nshellscript or use a git alias (dirty):\n\n[alias]\n  ediff = \"!sh -c 'git diff -- $(git ls-files | grep -Ev $0)'\"\n\nAnd call it with \n  git ediff \"(Documentation|compat/mingw.c)\"\n\nGreetings,\nJojo\n\n[1] - http://lists-archives.org/git/708604-how-to-exclude-files-from-git-diff.html\n\n-- \nJohannes Gilger <heipei@hackvalue.de>\nhttp://heipei.net\nGPG-Key: 0xD47A7FFC\nGPG-Fingerprint: 5441 D425 6D4A BD33 B580  618C 3CDC C4D0 D47A 7FFC\n"}]}