External Diff does not work.

fredzvt June 29, 2023

External Diff does not work, any ideas why? Is this a bug?

I'm using SourceTree 3.4.13 on Windows 10 Pro.

On my .gitconfig I have:

[difftool "sourcetree"]
cmd = 'D:/Program Files (x86)/WinMerge/WinMergeU.exe' \"$LOCAL\" \"$REMOTE\"

The path to WinMerge is correct.

And here is the GetExternalDiffProcess process log:

{
"Command": "git\r\n-c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks difftool -y --tool=sourcetree --\r\nAssets/DrestPrototype/Prefabs/UI/Tasks/Game Task.prefab",
"Directory": "D:\\Documents\\Projects\\Droid\\Unity_Prototype",
"Status": "Finished",
"Duration": "00:00:00.0651253",
"CallerContext": "GetExternalDiffProcess",
"Output": "warning: LF will be replaced by CRLF in Assets/DroidPrototype/Prefabs/UI/Tasks/Game Task.prefab.\nThe file will have its original line endings in your working directory\n"
}

The command has break lines and it looks completely wrong.

 

2 answers

0 votes
Stew Stryker
Contributor
June 29, 2023

Has it ever worked for you? I'm on 3.4.14, but it's worked for me since Day 2.

My .gitconfig shows:

[difftool "bc3"]

    path = C:/Program Files (x86)/Beyond Compare 3/bcomp.exe

    cmd = \"C:/Program Files (x86)/Beyond Compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"

Hope this helps.
0 votes
fredzvt June 29, 2023

Updated SourceTree to 3.4.14. Same behaviour.

Stew Stryker
Contributor
June 29, 2023

That's why I said it had worked for me since Day 2. I should have also included this definition:

[difftool "sourcetree"]
cmd = 'C:/Program Files (x86)/Beyond Compare 3/BComp.exe' \"$LOCAL\" \"$REMOTE\"

I don't see that it's any different from yours, except a different tool.

Looking at your Process Log, the "--tool=" reference makes me think you need to define your compare tool at the Git level???

I don't remember doing that and I don't use the command line much, so just a WAG.

Good luck.

fredzvt July 3, 2023

Hi, Stew!

No, it never worked for me, but I'd love to make this work.

Regarding defining the tool at the git level. The log shows up --tool=sourcetree. Isn't it correct?

What I think is the problem are those weird break lines in the command. I don't know if there is a way to remove these break lines in some configuration file.

"Command": "git\r\n-c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks difftool -y --tool=sourcetree --\r\nAssets/DrestPrototype/Prefabs/UI/Tasks/Game Task.prefab"
fredzvt July 3, 2023

I just found out this other question and I tried to change the single quotes for escaped double quotes on .gitconfig and it worked!

So, instead of

[difftool "sourcetree"]
cmd = 'D:/Program Files (x86)/WinMerge/WinMergeU.exe' \"$LOCAL\" \"$REMOTE\"

I have now 

[difftool "sourcetree"]
cmd = \"d:/Program Files (x86)/WinMerge/WinMergeU.exe\" \"$LOCAL\" \"$REMOTE\"


But I have the same problem as Jason in his question. If I open Tools > Options it rewrites .gitconfig and the External Diff command doesn't anymore again. Really annoying!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events