delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/01/15:43:48

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Date: Wed, 2 Dec 2009 09:43:33 +1300
Message-ID: <db95995b0912011243y3e75f0afqa5fb2d41d7d40540@mail.gmail.com>
Subject: [1.7] git-difftool paths unusable by win32 kdiff3
From: David Antliff <david DOT antliff AT gmail DOT com>
To: cygwin <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019