git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git diff/grep add --exclude option
@ 2010-04-12 21:02 Sylvain Rabot
  2010-04-15 20:25 ` Johannes Gilger
  0 siblings, 1 reply; 2+ messages in thread
From: Sylvain Rabot @ 2010-04-12 21:02 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

Hi,

I was surprised to not find an option to exclude file from git diff/grep
outputs like -x for diff or --exclude for grep. It's too bad because it
can be really useful.

Is something like that is planned to be implemented by somebody? I would
have loved to do it but unfortunately I'm no C developer.

Regards.

-- 
Sylvain Rabot <sylvain@abstraction.fr>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git diff/grep add --exclude option
  2010-04-12 21:02 git diff/grep add --exclude option Sylvain Rabot
@ 2010-04-15 20:25 ` Johannes Gilger
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Gilger @ 2010-04-15 20:25 UTC (permalink / raw)
  To: git

On 2010-04-12, Sylvain Rabot <sylvain@abstraction.fr> wrote:
> I was surprised to not find an option to exclude file from git diff/grep
> outputs like -x for diff or --exclude for grep. It's too bad because it
> can be really useful.

Yeah, me too, but probably because I never needed it ;) Anyway, there
were some discussions on this before [1]. I thin a viable workaround is
using ls-files and grep. Quick example:

git diff -- $(git ls-files | grep -Ev "(^Documentation|^compat/mingw.c)")

would show everything except the whole Documentation subtree and mingw.c
from compat. Now, you might even whip that into your very own
shellscript or use a git alias (dirty):

[alias]
  ediff = "!sh -c 'git diff -- $(git ls-files | grep -Ev $0)'"

And call it with 
  git ediff "(Documentation|compat/mingw.c)"

Greetings,
Jojo

[1] - http://lists-archives.org/git/708604-how-to-exclude-files-from-git-diff.html

-- 
Johannes Gilger <heipei@hackvalue.de>
http://heipei.net
GPG-Key: 0xD47A7FFC
GPG-Fingerprint: 5441 D425 6D4A BD33 B580  618C 3CDC C4D0 D47A 7FFC

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-15 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-12 21:02 git diff/grep add --exclude option Sylvain Rabot
2010-04-15 20:25 ` Johannes Gilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).