Re: [PATCH 8/9 v13] difftool: teach difftool to handle directory diffs

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

Re: [PATCH 8/9 v13] difftool: teach difftool to handle directory diffs

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

Tim Henigan [off-list ref] writes:
Looking back on it now, I agree that it would have been better to use
the plumbing commands from the beginning.  Changing from the porcelain
to the plumbing commands will require new logic to parse the diff
options to figure out which of 'diff-index', 'diff-files' or
'diff-tree' should be called.  We may also want to add support for
some specific standard diff options (like '-R').
Yeah, didn't I already suggest that it is the only sane avenue in the long
term to move the whole "populate the two temporary trees" thing down to C
level?
For now, would you object to an updated patch that simply detects and
ignores options that change the output of 'git diff --raw'?
As a script that uses 'git diff' is a short-term hack anyway, I think the
most cost effective thing to do is to add '--no-renames' at the end and be
done with it.

Re: [PATCH 8/9 v13] difftool: teach difftool to handle directory diffs

From: Tim Henigan <hidden>
Date: 2016-06-15 22:53:38

On Wed, Apr 18, 2012 at 3:38 PM, Junio C Hamano [off-list ref] wrote:
Tim Henigan [off-list ref] writes:
quoted
For now, would you object to an updated patch that simply detects and
ignores options that change the output of 'git diff --raw'?
As a script that uses 'git diff' is a short-term hack anyway, I think the
most cost effective thing to do is to add '--no-renames' at the end and be
done with it.
Adding '--no-renames' has no effect if the user specifies '-C -C' or
'--find-copies-harder'.  Is protecting for these cases too paranoid?

Also, the '--cc' option for viewing merge diffs is not affected by
'--no-renames'.

I have a revised patch that prunes out all of the above and warns the
user when it does so [1].

However, it also prunes them when difftool is called in serial diff
mode (i.e. non --dir-diff).  Before, if 'difftool
--find-[renames|copies]' was called it would open the external tool to
compare the two files, but the original file name was used for both
sides of the diff.

This seems confusing, but I don't know if people rely on that
behavior.  If we need to keep that behavior in the serial diff mode, I
will need to modify the patch again to only prune the options in
directory diff mode.

[1]: https://github.com/thenigan/git/commit/c3479940a36f3c7c8fe360bc244303b125f711ff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help