I have been following this post on how to use Winmerge as a diff tool in git. Initially it doesn't work (ok now, therefore irrelevant to my question here). One key difference is I'm using git provided inside MSYS2, not the msysgit under native Windows environment. The relevant git config fragment is:
[diff]
guitool = winmerge
[difftool "winmerge"]
cmd = \"????/WinMergeU.exe\" /e /s /u /r /wl \"$LOCAL\" \"$REMOTE\"
To my shock, some of the command line options of winmerge have been converted to drive letters upon execution, causing failure. The real command executed after git difftool -g is:
"????\WinMergeU.exe" /e S:/ U:/ R:/ D:/msys64/wl <file1> <file2>
Where D:/msys64 is my MSYS2 installation prefix. Note the inconsistency in errors — /e unconverted, /wl converted to path component, and all others to drive letters. A solution is found later by using - instead of / as prefix of all options:
[difftool "winmerge"]
cmd = \"????/WinMergeU.exe\" -e -s -u -r -wl \"$LOCAL\" \"$REMOTE\"
My question is:
- Why the inconsistent behavior? Is there any reference on how
cygpathperforms the path translation? - Luckily WinMerge accepts using
-as option indicator. For those GUI tools where only/is accepted, is there any workaround?