P4Merge diff doesn't show up
Asked by mangotamu:

Hi, this is Minku.

I have downloaded P4Merge and SourceTree 3.0.17.2659 on my 64-bit Windows 10 laptop.

![diff.png](/t5/image/serverpage/image-id/47447i49F16B8441FAC686/image-size/large?v=v2&px=999 "diff.png")![diff config.png](/t5/image/serverpage/image-id/47446iFF346C73894B80D3/image-size/large?v=v2&px=999 "diff config.png")The W looking thing is a WON currency. It is shown like this because I'm using a Korean-based laptop.

<https://superuser.com/questions/787664/why-are-backslashes-displayed-as-%E2%82%A9-korean-won-sign-w-strikethrough-in-not>

However, after I click the "external diff", nothing happened.

How can I launch P4Merge and compare files?

-Thanks for the help, MInku


Answers:
author: minnsey
body: Hi  

It is possible this is a bug, we have a fixed some in this area in the upcoming 3.1, but can you check the contents of your git config, it should look like  

difftool.sourcetree.cmd='C:/Program Files/Perforce/p4merge.exe' "$LOCAL" "$REMOTE"  
mergetool.sourcetree.cmd='C:/Program Files/Perforce/p4merge.exe' "$BASE" "$LOCAL" "$REMOTE" "$MERGED"  
mergetool.sourcetree.trustexitcode=true  

Also in the Tools/Options/Diff tab I would expect to see the path to the P4 .exe

comments: author: mangotamu
body: Hi, Michael. I'm using P4Merge and SourceTree 3.0.17.2659 on my 64-bit Windows 10 laptop.

Mine is configured as

\[difftool "sourcetree"\]  
cmd = 'C:/Program Files/Perforce/p4merge.exe' \\"$LOCAL\\" \\"$REMOTE\\"  
\[mergetool "sourcetree"\]  
cmd = 'C:/Program Files/Perforce/p4merge.exe' \\"$BASE\\" \\"$LOCAL\\" \\"$REMOTE\\" \\"$MERGED\\"  
trustExitCode = true

**But still, P4Merge doesn't show up when I choose "External Diff"** .  

I wish to get your help.


author: minnsey
body: That looks correct.  

Is there anything in the Event Viewer or %localappdata%/Atlassian/Sourcetree/Sourcetree.log indicating an error?  

Also if you try installing an alternative like kdiff3 and configuring that does it start working?


author: mangotamu
body: Hi, Michael

"Also if you try installing an alternative like kdiff3 and configuring that does it start working?"

I installed the KDiff3 64-bit. This works when I press Ctrl+D.

![Kdiff3.png](https://community.atlassian.com/t5/image/serverpage/image-id/48082iC8845E968DC75B00/image-size/large?v=v2&px=999 "Kdiff3.png")

Here's what I found. My Scenario:

![s1-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/48083i31723CC2FAAA019E/image-size/large?v=v2&px=999 "s1-1.png")

Set the Diff tool to KDiff3. Then execute Ctrl+D and we will see it is working.

The KDiff3 really pops up fast that it didn't took a second. I'm testing this with a laptop that has i3 processor and SSD, BTW.

Now go back to settings and choose P4Merge.

![s1-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/48084iF978B5889D0C9DA5/image-size/large?v=v2&px=999 "s1-2.png")

Surprisingly, compared to the case when I choose KDiff3, if I choose P4Merge, it shows a blank on the Diff Command. Anyways, I pressed Okay.

**NOW**, when I press Ctrl+D, P4Merge pops up.

But it took like 3.5 seconds and I noticed the green progress bar. This bar doesn't always appear after pressing Ctrl+D.

So I thought everything was solved. **However, after I turn off SourceTree and run it again, P4Merge doesn't show up when I press Ctrl+D.**

In contrast, when I have a merge conflict, P4Merge does pop up when I try to solve the conflict with the external diff tool.

Can you guys try this as well and see if this is re-generatable on your side?

-Thanks


author: minnsey
body: Thanks for the additional details.  

A couple of notes.  

When you change diff/merge tool the path will initially be empty it gets set when you close the preferences, so that is OK.  

Are you using Git or Mercurial? We are aware of some issues with Mercurial and external diff/merge tools which are fixed in the upcoming 3.1 release.


author: mangotamu
body: - Are you using Git or Mercurial?

Hi, Michael. I'm using Git only. In detail, I tried this when I used SourceTree's embedded Git/downloaded Git manually.

![GitVersion.png](https://community.atlassian.com/t5/image/serverpage/image-id/48321iC478FCF24C2909AB/image-size/large?v=v2&px=999 "GitVersion.png")

Both cases made the same aforementioned result.

i haven't installed Mercurial.


author: Mike Corsaro
body: Hello! Could you post a part of your ".git" config file for me? You can find it under "C:\\Users\\USERNAME_HERE\\.git"

Please post the part under "\[difftool "sourcetree"\]"

Thanks!

comments: author: mangotamu
body: Hi, Mike.

![config.png](https://community.atlassian.com/t5/image/serverpage/image-id/47682i12D6BE0442D4B760/image-size/large?v=v2&px=999 "config.png")

\[difftool "sourcetree"\]  
cmd = 'C:/Program Files/Perforce/p4merge.exe' \\"$LOCAL\\" \\"$REMOTE\\"  
\[mergetool "sourcetree"\]  
cmd = 'C:/Program Files/Perforce/p4merge.exe' \\"$BASE\\" \\"$LOCAL\\" \\"$REMOTE\\" \\"$MERGED\\"  
trustExitCode = true

When I opened it, it was shown like the above picture.

**But still, P4Merge doesn't show up when I choose "External Diff"** .  


Tags: diff

p4merge