Git Difftool Meld Doesn't Work in Babun
Asked Answered
R

1

6

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?

Regenerator answered 2/2, 2017 at 11:52 Comment(0)
R
8

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")"'
Regenerator answered 2/2, 2017 at 12:13 Comment(1)
If you're using it on Windows 10 then git config --global difftool.meld.cmd '/mnt/c/Program\ Files\ \(x86\)/Meld/Meld.exe "$LOCAL" C:\\Users\\james.collerton\\AppData\\Local\\lxss\\rootfs\\"$REMOTE"' works.Regenerator

© 2022 - 2024 — McMap. All rights reserved.