On Fri, Mar 7, 2014 at 8:07 AM, Paul Lotz <pl...@lsst.org> wrote:
> 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?
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
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
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.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html