Open CmdQ opened 3 years ago
I am not familiar with git and wsl, but the following configuration appeared to work.
[~/.gitconfig]
[difftool "winmerge"]
name = WinMerge
cmd = /mnt/c/Program\\ Files/WinMerge/WinMergeU.exe -u -e -xq -wl \"$(wslpath -aw $LOCAL)\" \"$(wslpath -aw $REMOTE)\"
trustExitCode = true
$ git difftool --tool=winmerge
Git in WSL is just like in a “real” Linux.
I'm fairly sure I had your configuration already, but with additional inner quotes. But now even that works—confused.
So yes, you've presented a workable solution. What I don't like about it is that it is specific to WSL and I'd need a different config for a Windows/Mac/Linux machine at home.
I just thought there are probably a lot of people using WSL nowadays and it would be great if WinMerge acknowledged that by understanding linux paths.
I'd like to use WinMerge from the WSL2 terminal and have set it up as diff and merge tool.
I think it used to work before but not it doesn't. It does understand the hyphens but it thinks that the leading slash of a file path is meant to be an option:
As the files are only positional arguments only, I did not find a way to force an argument to be interpreted as path.
I tried
wslpath -am
but that still begins with a slashwslpath -aw
but the shell doesn't like the backslashes and it totally breaksI do almost all my work in WSL and it would be really nice to occasionally run a simple
git difftool
with WinMerge.Could you provide a way to force interpretation as path? Or alternatively not error out if a given “option” happens to be an existing file.