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

Re: difftool sends malformed path to exernal tool on Windows

From
David Aguilar <davvid@gmail.com>
Date
Mar 16, 2014, 07:27 UTC
Message-ID
<CAJDDKr7=OVF0eJQFjFqrzNvOW0K0pZfRJL+CHB32kHoJFJ_csg@mail.gmail.com>
In-Reply-To
<019d01cf3a1f$4ebfe5f0$ec3fb1d0$@lsst.org>
On Fri, Mar 7, 2014 at 8:07 AM, Paul Lotz <plotz@lsst.org> wrote:
Show 5 quoted lines
> David,
>
> I investigated further and found that \"$LOCAL\" \"$REMOTE\" return the remote and local files (reversed).  (One can easily see this in my 2/28 e-mail.)  Reversing these (\"$REMOTE\" \"$LOCAL\") does indeed reverse the output.  It is easy to work around this issue, but how can this be?
>
> Paul
It's probably working as intended.

The $LOCAL and $REMOTE names come from "git mergetool", where they have better defined semantics.

In the context of a diff, where we're really comparing "A" and "B" they have a little less meaning, but the behavior is well-defined.

When you modify a file locally, the default behavior for "git diff" is to compare your working tree against the index.

The diff will show the changes that will permute the index's copy into the the worktree's copy. In a sense, your modifications are the "remote" thing that is being compared against.

That's why you see a temporary file for $LOCAL ("A") and your worktree's file for $REMOTE (B).

If compare two other things, e.g. "git difftool HEAD~3 HEAD~" then $LOCAL is HEAD~3 and $REMOTE is HEAD~, and they'll all be temporary files.

One analogy is that the $LOCAL thing is the starting point and the $REMOTE thing is what was modified (by the merge) if you think of it from the merging perspective.

Specific tools (e.g. lvcompare) may need the arguments to be specified in a specific order for them to make sense, so it's perfectly acceptable for specific tools to require that $LOCAL and $REMOTE are swapped.

BTW.. we went through a lot of back-and-forth getting the difftool setup correct for lvcompare. In the Git source tree there's a mergetools/ directory where all of the built-in diff/merge tools are defined. Do you think you might be able to contribute a scriptlet for lvcompare so that it is natively supported? That'll save future poor souls from needing to rediscover the correct recipe for getting lvcompare working with difftool. Just a thought.

cheers,
-- 
David
Previous: Paul LotzNext: Paul Lotz
Message 9 of 10 in “difftool sends malformed path to exernal tool on Windows”
  1. Paul LotzFeb 17, 2014
  2. David AguilarFeb 21, 2014
  3. Paul LotzFeb 24, 2014
  4. David AguilarMar 3, 2014
  5. Paul LotzMar 3, 2014
  6. David AguilarMar 5, 2014
  7. Paul LotzMar 5, 2014
  8. Paul LotzMar 7, 2014
  9. David AguilarMar 16, 2014
  10. Paul LotzFeb 28, 2014

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.