delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/01/16:11:53

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <4B15868D.7010809@bopp.net>
Date: Tue, 01 Dec 2009 15:11:41 -0600
From: Jeremy Bopp <jeremy AT bopp DOT net>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [1.7] git-difftool paths unusable by win32 kdiff3
References: <db95995b0912011243y3e75f0afqa5fb2d41d7d40540 AT mail DOT gmail DOT com>
In-Reply-To: <db95995b0912011243y3e75f0afqa5fb2d41d7d40540@mail.gmail.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

David Antliff wrote:
> 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

As a fairly simple workaround, you could create a wrapper script which
takes the same set of arguments git difftool gives to kdiff3 and
converts the given file paths using cygpath -w before exec'ing the real
kdiff3.  Then you can point to that wrapper by setting the git
configuration variable difftool.kdiff3.path to the path for the wrapper
script.  Run "git difftool --help" for more information.

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

If you want git difftool to function more like git mergetool with
respect to temporary files, you probably need to ask the git maintainers
about it rather than the git package maintainer for Cygwin.  That's what
I would do at least. :-)

-Jeremy

--
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