How to use ExamDiff Pro with git and WSL2

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
dchirgwin
New Member
Posts: 9
Joined: Thu Apr 13, 2017 12:22 am

How to use ExamDiff Pro with git and WSL2

Post 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
User avatar
psguru
Site Admin
Posts: 2137
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: How to use ExamDiff Pro with git and WSL2

Post 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?
psguru
PrestoSoft
MudGuard
Expert Member
Posts: 69
Joined: Mon Jun 07, 2004 12:42 am

Re: How to use ExamDiff Pro with git and WSL2

Post 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?
dchirgwin
New Member
Posts: 9
Joined: Thu Apr 13, 2017 12:22 am

Re: How to use ExamDiff Pro with git and WSL2

Post 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
dchirgwin
New Member
Posts: 9
Joined: Thu Apr 13, 2017 12:22 am

Re: How to use ExamDiff Pro with git and WSL2

Post 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
Post Reply