[1.7] git-difftool paths unusable by win32 kdiff3

David Antliff david.antliff@gmail.com
Tue Dec 1 20:43:00 GMT 2009


My subject keeps getting blocked due to "spam-like" keywords, perhaps
it will work this time:


I'd like to report this here but I don't really have a general
solution. Perhaps someone who knows better can comment.

In git-1.6.1.2 [1.5] and git-1.6.4.2 [1.7] there is a command called
'git-mergetool' that is used as a wrapper for various graphical
merging tools, such as kdiff3. It makes local copies of the relevant
commits and brings up an interactive gui for resolving merge conflicts.

In git-1.6.4.2 there is a new command called 'git difftool' that does
a very similar thing, except it's designed to show the output of 'git
diff' in a graphical tool, rather than a merge.

git-mergetool works very well with a native Windows (i.e. not Cygwin)
installation of kdiff3 because it creates its working files in the
current working directory, usually called:
 ./<original-file>.LOCAL.xxxx.<ext> and ./<original-file>.REMOTE.xxxx.<ext>.
Because these paths are relative to the CWD, the non-Cygwin version of
kdiff3 handles this fine. E.g:

kdiff3 --auto --L1 build.xml (Base) --L2 build.xml (Local) --L3
build.xml (Remote) -o build.xml ./build.xml.BASE.5512.xml
./build.xml.LOCAL.5512.xml ./build.xml.REMOTE.5512.xml

But git-difftool does something slightly different - it creates the
temporary versions of the file in /tmp with a random prefix, e.g.
/tmp/Vc0BZy_<original-file>. This causes the Windows version of kdiff3
to fail to open the file, because the path "/tmp/...." is invalid. In
my case, the path that would work is "c:/cygwin-1.7/tmp/..." instead:

kdiff3 --auto --L1 "build.xml (A)" --L2 "build.xml (B)"
/tmp/Vc0BZy_build.xml build.xml

It's the  /tmp/... bit that kdiff3 can't understand. On the other
hand, this command does work:

kdiff3 --auto --L1 "build.xml (A)" --L2 "build.xml (B)"
c:/cygwin-1.7/tmp/Vc0BZy_build.xml build.xml

Perhaps git-difftool should create the temporary file in CWD just like
git-mergetool, rather than the Cygwin-specific path /tmp?

I'm using the Windows version of kdiff3 to avoid dependency on the
graphical X libraries that Cygwin's kdiff3 would require. I think it's
a fairly common thing to do when working with git on Windows. I can
see that the Cygwin version of kdiff3 would probably not exhibit this problem.

I imagine the same problem will occur with other Windows versions of
merge/diff tools.

I also understand if there's no intention by the Cygwin git maintainer
to support non-Cygwin gui merge tools, but I don't think I'm the only
person using them extensively.

-- David.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list