Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Difftool Meld Doesn't Work in Babun

I'm currently setting up the Meld difftool to work in Babun using the following commands:

git config --global diff.tool meld
git config --global difftool.prompt false
git config --global difftool.meld.path "/cygdrive/c/Program\ Files\ \(x86\)/Meld/Meld.exe"
git config --global difftool.meld.cmd '/cygdrive/c/Program\ Files\ \(x86\)/Meld/Meld.exe $LOCAL $REMOTE'

This works, and Meld opens with the two files when I run

git difftool HEAD HEAD^

However, the second file (from the remote) doesn't open, and I get

There was a problem opening the file "\tmp\xxx_FILENAME.EXTENSION"

However, when I run the difftool from git bash it works. Is there something wrong in my setup?

like image 235
JCollerton Avatar asked Feb 02 '17 11:02

JCollerton


1 Answers

The problem was accessing the temp files from Cygwin. Because Cygwin has its own drives I needed to use cygpath to format the filepaths. The full setup is below:

git config --global diff.tool meld
git config --global difftool.prompt false
git config --global difftool.meld.path "c:\Program Files (x86)\Meld\Meld.exe"
git config --global difftool.meld.cmd 'c:/Program\ Files\ \(x86\)/Meld/Meld.exe "$(cygpath -w "$LOCAL")" "$(cygpath -w "$REMOTE")"'
like image 75
JCollerton Avatar answered Sep 21 '22 00:09

JCollerton