git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Display change history as a diff between two dirs

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 1, 2011, 17:15 UTC
Message-ID
<7vr51rn4qc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CANEMaQRoXRygmrYsu0xF6mWq50r9Qhh-YuXXNAhyQewd+fDtsQ@mail.gmail.com>
Roland Kaufmann <rlndkfmn+git@gmail.com> writes:
Show 13 quoted lines
> On Tue, Nov 1, 2011 at 04:49, Junio C Hamano <gitster@pobox.com> wrote:
>> Roland Kaufmann <rlndkfmn+git@gmail.com> writes:
>>> Would it be better to have yet another configuration available for
>>> this option instead of reusing the existing infrastructure for `git
>>> difftool`?
>
>> 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, and
>
> Did 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.

Previous: Roland Kaufmann
Message 6 of 6 in “Display change history as a diff between two dirs”
  1. Display change history as a diff between two dirsRoland Kaufmann, Oct 29, 2011
  2. Junio C HamanoOct 30, 2011
  3. Roland KaufmannOct 31, 2011
  4. Junio C HamanoNov 1, 2011
  5. Roland KaufmannNov 1, 2011
  6. Junio C HamanoNov 1, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.