Re: [HALF A PATCH] Teach the '--exclude' option to 'diff --no-index'

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [HALF A PATCH] Teach the '--exclude' option to 'diff --no-index'

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:15

Johannes Schindelin [off-list ref] 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 <redacted>
---

	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?

Re: [HALF A PATCH] Teach the '--exclude' option to 'diff --no-index'

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:46:16

Hi,

On Fri, 20 Feb 2009, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
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 <redacted>
---

	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help