Re: [HALF A PATCH] Teach the '--exclude' option to 'diff --no-index'
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 24, 2009, 16:15 UTC
- Message-ID
- <alpine.DEB.1.00.0902241713520.10279@pacific.mpi-cbg.de>
- In-Reply-To
- <7v1vttt6d4.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, 20 Feb 2009, Junio C Hamano wrote:
Show 24 quoted lines
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
> > 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?The principal aim of this patch was to support git diff --no-index -x, that is why (and in addition, avoiding unnecessary work when we can exclude stuff already early in the code path).
It is unlikely that I will work on this before next week.
Thanks, Dscho