SourceTree pref > "KDiff3 Not Found" (But it's there!)
Asked by GlyEthan:

Where does SourceTree expect to find KDiff3 on OSX?

SourceTree 1.5.8 on OSX, under Preferences \> Diff:

I attempt to set KDiff3 as my Diff and/or Merge tool, but SourceTree pops up an error:
> KDiff3 was not found on this Mac, please install KDiff3 before... (etc.)

Initially KDiff3 was not installed, so I installed it via MacPorts, and restarted SourceTree ... same error. I added a symlink to kdiff3 under /usr/bin and again restarted SourceTree and attempted to set the preference: same error. I can manually launch kdiff3 via terminal from any working directory just fine.

Other system info: OSX 1.8.3, MacPorts 2.1.3

I know I can configure this manually via gitconfig, but if I'm having this trouble, maybe other people are too.


Answers:
author: KieranA
body: Hi GlyEthan,

We don't assume kdiff3 is installed using MacPorts, instead using the dmg provided by the kdiff3 team themselves here (<http://sourceforge.net/projects/kdiff3/files/latest/download?source=files>). I just installed ran the DMG and copied the .app over to my Applications folder and it worked fine.

SourceTree assumes the kdiff3 console application is in /Applications/kdiff3.app/Contents/MacOS/kdiff3 as you stated, and the DMG will install it to there provided it's dragged over into the Applications folder.

As the DMG is provided on SourceForce you shouldn't have to use MacPorts to install it. You're right that you could probably use a symlink so that the kdiff3 folder in Applications exists with the necessary folder structure for SourceTree to pick it up, but we assume that users are installing the application via the regular means.

Hope that helps, if not, feel free to ask any other questions.

comments: author: Sam Bishop
body: > SourceTree assumes the kdiff3 console application is in /Applications/kdiff3.app/Contents/MacOS/kdiff3

Thats a pretty major assumption to be making. A flawed one in my personal book, but thats not the point. Will this 'bug' be fixed? Sourcetree can use my 'system git' my 'system hg' and my 'system git flow' ... yet it can't use my 'system kdiff3'?


author: KieranA
body: Hi Sam,

There's no other way to pick up kdiff3 otherwise. It won't be on your PATH most likely so we can't just call 'kdiff3' and neither can we call 'locate kdiff3' because that could return many result (all of which could be wrong). So as you can see, it's literally impossible for us. We assume that path because that's the path it will be in 99% of the cases.

In your case you want to use the "Other" option in the drop-down and supply the necessary values in order to end up with the same result.

Hope that helps


author: Sam Bishop
body: How does sourcetree know that git is installed on the system? What about git flow? I struggle to see how you can detect these 2 command line tools yet not a different command line tool.

As for 'other', I know that works since it was how i actually had kdiff3 working before i tried using any other mac Diff programs, which was how i tripped over this problem in the first place. I'm just perplexed that its a problem at all given that Sourcetree can find my system git and git flow.


author: KieranA
body: Hi Sam,

SourceTree comes with Git embedded. If you choose to use system Git then it will ask for the location. The exact same concept applies with git-flow simply because the install locations are so varied. As I say, there's no way we could possibly know the correct location as with all things there can be multiple locations, and search results can yield many different things that aren't related, especially when it comes to a 'compare' application.

The SourceTree diff preferences are aimed at 99% of the cases, the other 1% just use the 'Other' option and specify the options manually. If you've got any suggestions on how to improve on this we're always willing to listen and help out, it's just in this case there's no truly effective way we can determine the precise location without user intervention regardless of what approach we take to the problem at hand.

Cheers


author: GlyEthan
body: SourceTree expects to find it under:

/Applications/kdiff3.app/Contents/MacOS/kdiff3

MacPorts doesn't install the "app" -- to install this, use the standard KDiff3 download for OSX found at: <http://kdiff3.sourceforge.net/>

Alternately, you could probably create the above folder structure and put a symlink to kdiff3 in it.


Tags: kdiff3

mac