git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Paul Lotz <plotz@lsst.org>
Cc: 'Git Mailing List' <git@vger.kernel.org>
Subject: Re: difftool sends malformed path to exernal tool on Windows
Date: Wed, 5 Mar 2014 00:25:18 -0800	[thread overview]
Message-ID: <20140305082517.GA86532@gmail.com> (raw)
In-Reply-To: <00bc01cf3737$b1474280$13d5c780$@lsst.org>

On Mon, Mar 03, 2014 at 04:24:15PM -0700, Paul Lotz wrote:
> David,
> 
> OK, I did as you suggested, and the results were revealing.
> 
> First, I replaced "echo" with "cat".  Result: The contents of both files appeared in the Git Bash Window.
> 
> Then I tried calling LVCompare from the Git Bash and Windows Command Prompt windows with variations on the paths.
> 
> Here are the most relevant results:
> First from the Windows Command Prompt:
> 1) This command works:
> C:\LSST_TS\SystemSW\M2AADT>"C:\Program Files (x86)\National Instruments\Shared\L
> abVIEW Compare\LVCompare.exe" C:\Users\Paul\AppData\Local\Temp\Typedefs_TestStat
> us_Before.ctl C:\LSST_TS\SystemSW\M2AADT\Typedefs\TestStatus.ctl
> [General note:
> I saved a copy of the temp file and replaced the hex string with the string 'Before' to make the file stick around.  The paths are otherwise the same.]

This is aligns with: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/configlvcomp_thirdparty/

	"lvcompare.exe <absolute path to VI 1> ..."

The key thing is the mention of absolute paths.

What is happening is that lvcompare.exe (or likely it's a
Windows thing) changes its current directory to its installation
directory under Progra~1.

That means the relative paths passed in by difftool won't be found.

The way to fix it is to redirect your difftool config to a script
that makes all paths absolute.  This script can then call the real
lvcompare.exe.

You just need to tweak the lvcompare part in your .gitconfig
to look like this:

[difftool "lvcompare"]
	cmd = ~/bin/lvcompare.sh \"$LOCAL\" \"$REMOTE\"


... and install an executable lvcompare.sh shell script in in
your $HOME/bin.  Something like this:

#!/bin/sh

abspath () {
	(
		cd "$(dirname "$1")" &&
		printf "%s/%s" "$(pwd)" "$(basename "$1")"
	)
}

lvcompare="C:\\Program Files (x86)\National Instruments\\Shared\\LabVIEW Compare\\LVCompare.exe"
local=$(abspath "$1")
remote=$(abspath "$2")
exec "$lvcompare" "$local" "$remote"

> 2) C:\LSST_TS\SystemSW\M2AADT>"C:\Program Files (x86)\National Instruments\Shared\L
> abVIEW Compare\LVCompare.exe" C:\Users\Paul\AppData\Local\Temp\Typedefs_TestStat
> us_Before.ctl Typedefs\TestStatus.ctl
> 
> Result: Error message with reference to C:\Program Files (x86)\National Instruments\Shared\L
> abVIEW Compare\supportVIs\_prolvcmp.llb\Typedefs\TestStatus.ctl
> 
> Observation: The second path has to be the full path, not the relative path we get back using "echo".

Yes, that's what it looks like.
-- 
David

  reply	other threads:[~2014-03-05  8:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-17 22:14 difftool sends malformed path to exernal tool on Windows Paul Lotz
2014-02-21 10:38 ` David Aguilar
2014-02-24 16:44   ` Paul Lotz
2014-03-03  0:35     ` David Aguilar
2014-03-03 23:24       ` Paul Lotz
2014-03-05  8:25         ` David Aguilar [this message]
2014-03-05 22:28           ` Paul Lotz
2014-03-07 16:07           ` Paul Lotz
2014-03-16  7:27             ` David Aguilar
2014-02-28 15:56   ` Paul Lotz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140305082517.GA86532@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=plotz@lsst.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).