Re: [HALF A PATCH] Teach the '--exclude' option to 'diff --no-index'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 20, 2009, 16:34 UTC
- Message-ID
- <7v1vttt6d4.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <cf17659db8a4f7fe9d878984effcdd8d6417c862.1235138849u.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 17 quoted lines
> With this patch, it is possible to exclude files based on basename > patterns. Example: > > $ git diff --no-index -x Makefile -x Makefile.in a/ b/ > > In this example, the recursive diff between a/ and b/ will be shown > modulo changes in files named 'Makefile' or 'Makefile.in'. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > --- > > Michael wrote: > > > I can't think offhand of a more portable tool that could replace > > "diff -r -x" here (suggestions, anyone?). > > Maybe something like this?
I agree that diff_options is the logical way to hook this information and diff_opt_parse() is the right place to add this, but why isn't this done at diff_{addremove,change,unmerge}() layer? That way you should be able to cover both no-index special case and the normal diffs, no?