Re: [PATCH] Display change history as a diff between two dirs
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:21
Roland Kaufmann [off-list ref] writes:
On Tue, Nov 1, 2011 at 04:49, Junio C Hamano [off-list ref] wrote:quoted
Roland Kaufmann [off-list ref] writes:quoted
Would it be better to have yet another configuration available for this option instead of reusing the existing infrastructure for `git difftool`?quoted
It probably is OK for "git diff --dirdiff" to use GIT_EXTERNAL_TREEDIFF if and only if GIT_EXTERNAL_DIFF is not defined, and use GIT_EXTERNAL_DIFF otherwise. People who have GIT_EXTERNAL_DIFF set to a tool capable of handing directory pair can just add "--dirdiff" to the command line, andDid you perhaps mean the other way around: GIT_EXTERNAL_TREEDIFF if set, and GIT_EXTERNAL_DIFF otherwise?
I think I misstated the precedence order. What I had in mind was roughly
like this:
1. "git diff" (and others like "git log") without "--dirdiff" option:
GIT_EXTERNAL_DIFF is used just as before and no GIT_EXTERNAL_TREEDIFF
is consulted;
2. "git diff --dirdiff": GIT_EXTERNAL_TREEDIFF is used if set, otherwise
GIT_EXTERNAL_DIFF is used.
That way, people who have been using GIT_EXTERNAL_DIFF that is capable of
comparing two directories do not have to change anything and can just give
"--dirdiff" when they want to operate the command with this new mode of
comparison. People whose GIT_EXTERNAL_DIFF is not capable of comparing two
directories have two choices, but in either case they first would need to
find an external tool they want to use with the "--dirdiff" mode. If they
want to use the same new external tool for non "--dirdiff" mode, then they
can set GIT_EXTERNAL_DIFF to it. If they want to keep using the command
they have been using with GIT_EXTERNAL_DIFF when not in "--dirdiff" mode,
however, they can keep their GIT_EXTERNAL_DIFF to the old "two files
comparison" tool, and set GIT_EXTERNAL_TREEDIFF to the new one.
But that is all about envisioning how a proper integration of the feature
in the main "diff/log -p" command codepath would work. I do not know if it
is worth to add that to your script, which would be a stop-gap experiment
until we find out if the "populate two temporary directories and have a
tool compare them as a whole" mode is useful.