Page 1 of 1

How to use ExamDiff Pro with git and WSL2

Posted: Thu Jan 20, 2022 4:18 am
by dchirgwin
I'm doing Linux development using WSL2, but I still want to use ExamDiff Pro as my git difftool.

Turns out there is an easy way to do this, so I'm sharing it here for others to use (maybe it could be added to the https://www.prestosoft.com/edp_versioncontrol.asp page?)

All you need to do is edit your "~/.gitconfig" file to include the following:

Code: Select all

[diff]
        tool = edp
        guitool = edp
[difftool "edp"]
        cmd = /mnt/c/Program\\ Files/ExamDiff\\ Pro/ExamDiff.exe \"$(wslpath -aw $REMOTE)\" \"$(wslpath -aw $LOCAL)\" /nh
[difftool]
        prompt = false
Note that you have to edit the file, you cannot use "git config" from the command line because it will immediately evaluate wslpath, whereas you want it to evaluate wslpath when it actually invokes ExamDiff Pro.

Note - when using the git option "--dir-diff" you need to also use "--no-symlinks".

Code: Select all

git difftool --dir-diff --no-symlinks
There is some related information here for further reading:
https://stackoverflow.com/questions/638 ... ol-on-wsl2

You're welcome!
Dave C

Re: How to use ExamDiff Pro with git and WSL2

Posted: Thu Jan 20, 2022 10:43 am
by psguru
Thanks for posting this. Before we update https://www.prestosoft.com/edp_versioncontrol.asp, let me ask you: do you have the details of setting up EDP as a merge tool as well?

Re: How to use ExamDiff Pro with git and WSL2

Posted: Thu Jan 20, 2022 12:27 pm
by MudGuard

Code: Select all

[diff]
        tool = examdiff
[diff "tool"]
        prompt = false
[diff "tool.examdiff"]
        trustExitCode = true
        cmd = '/C/Program Files/ExamDiff Pro/ExamDiff.exe'
        prompt = false
is what I have in my user .gitconfig

And I use a batch file named "git-devdiff"

Code: Select all

#!bash
#diff current branch to (local) develop
git difftool --dir-diff develop &
to compare current branch to our develop branch.

@dchirgwin: I do not use the "--no-symlinks" - and I have found no problem so far. Why do you think it is necessary?

Re: How to use ExamDiff Pro with git and WSL2

Posted: Thu Jan 20, 2022 11:27 pm
by dchirgwin
Hi @Mudguard,

I suspect we are doing slightly different things here.

I am invoking ExamDiff Pro from the WSL2 Linux command line, and there is no such path "/C/Program Files/..." at that point. However, if I open a Cygwin command line in Windows (e.g. by spawning a terminal from SourceTree) then my filesystem looks like what you have described.

Also, I see that your command does not refer to $REMOTE and $LOCAL, so how does it know to pick up the correct files/folders?

Regards,
Dave C

Re: How to use ExamDiff Pro with git and WSL2

Posted: Thu Jan 20, 2022 11:30 pm
by dchirgwin
psguru wrote: Thu Jan 20, 2022 10:43 am Thanks for posting this. Before we update https://www.prestosoft.com/edp_versioncontrol.asp, let me ask you: do you have the details of setting up EDP as a merge tool as well?
No, I haven't tried that yet. I expect the configuration will be similar - I'll post something soon when I've had a chance to play with it.

Regards,
Dave C