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, 03:49 UTC
Message-ID
<7v39e8o61s.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4EAE688C.8010502@gmail.com>
Roland Kaufmann <rlndkfmn+git@gmail.com> writes:
Show 8 quoted lines
>> "git diff" (and possibly even things like "git log -p") populating
>> two temporary directories (your old/ and new/) and running a custom
>> program specified by GIT_EXTERNAL_TREEDIFF environment variable,
>> instead of doing
>
> Would it be better to have yet another configuration available for
> this option instead of reusing the existing infrastructure for `git
> difftool`?

GIT_EXTERNAL_DIFF is designed to drive tools that can take a single pair of files and compare, so it is entirely possible for people to have such tool that would _not_ grok (as a tool named by the variable does not have to) two directories specified by it. So yes, it is essential that the variable not be reused.

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 others can find such a tool and set it to GIT_EXTERNAL_TREEDIFF when they do so.

Show 6 quoted lines
>> It also is not clear what could be used in "$@". Obviously you would
>>  not want things like "-U20" and "--stat" fed to the first "list of
>> paths" phase, but there may be some options you may want to give to
>> the inner "external diff" thing.
>
> Ideally, it should work the same way as `git difftool`.

I am not so sure about that; difftool is another way to drive a tool one filepair at a time. You want to drive a tool that takes them as two _sets_ of files, one in each directory.

Previous: Roland KaufmannNext: Roland Kaufmann
Message 4 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.