I used @VonC's excellent instructions to configure my development system so that git difftool <BRANCH1> <BRANCH1>
will invoke WinMerge. Here is what I did:
Placed the following in
~/.gitconfig
:[diff]
tool = winmerge
[difftool "winmerge"]
cmd = winmerge.sh \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
Created a
/usr/bin/winmerge.sh
with the following content:echo Launching WinMergeU.exe: $1 $2
"C:/Program Files (x86)/WinMerge/WinMergeU.exe" -e -ub "$1" "$2"
Now, when I try to launch WinMerge via git difftool <BRANCH1> <BRANCH1>
, I receive what seems to be correct parameter passing:
Launching WinMergeU.exe: /tmp/21qMVb_file1.c /tmp/1ACqik_file1.c
But, for some strange reason, instead of WinMerge displaying the two files side-by-side, it prompts for entering the first file as the right-side, with the second file accepted as the left-side:
Why is this happening? What did I miss in the configuration steps?
P.S. When I type on the command line winmerge.sh file1.c file2.c
, WinMerge immediately displays the two files side-by-side, just as I would expect.
UPDATE: Oh wow, I just noticed the Both paths are invalid
message at the bottom of WinMerge's prompt (and updated the screenshot to emphasize that). It appears that these files simply weren't generated by difftool or something is wrong with the path.
winmerge.sh
. It seems to me that the weirdness of my system configuration works against me...cygwin-1.7.8-1
+git version 1.7.4
+Windows 7 Ultimate 64-bit
with my$HOME=/home
which is mounted as//sambaserver/projshare
on/home
. – FranconianHOME
on a more conventional PATH?C:\...
Chances are your script works only in a bash environment, not in a Windows one. – Bernabernadene