Using MATLAB comparison as an external diff tool
古いコメントを表示
I am using Git and SourceTree for source control. How can I use MATLAB comparison tool as an external diff tool there? How should I change the .gitconfig or set the required command in SourceTree diff option?
1 件のコメント
Henning S Larsen
2017 年 1 月 4 日
Can't this be done?
回答 (3 件)
Steven Lord
2017 年 1 月 4 日
3 投票
As of release R2016b you can use the instruction on this page in the documentation to configure an external source control tool to use the MATLAB Comparison Tool to diff and merge code.
5 件のコメント
TS
2018 年 4 月 16 日
Please expand on this answer since following the linked guide and adding the following to "Arguements" in Sourcetree -> Options -> Diff -> External Diff -> Costum (Diff Command is the path of "comparisons.ExternalSCMLink.setup()"):
$BASE $LOCAL
generates the error:
MATLAB encountered a problem receiving a comparision request from an external source control tool. Try again.
Details:
Path\AppData\Local\Temp\mwDiffLinkServer*.log
Using Matlab 2018a + Sourcetree 2.4.8.0
Steven Lord
2018 年 4 月 16 日
Please send the log file to Technical Support and work with them to determine why MATLAB has encountered a problem. You can contact Support using the Contact Us link in the upper-right corner of this page.
TS
2018 年 4 月 16 日
When using $LOCAL $REMOTE instead of $BASE $LOCAL$ as arugment, the call to the comparision tool succeeds
https://community.atlassian.com/t5/Sourcetree-questions/SourceTree-external-diff-tool/qaq-p/35047
David Barry
2018 年 9 月 18 日
@TS I am having the exact same problem as you but swapping to %LOCAL %REMOTE doesn't seem to solve it for me. I have attached a screenshot showing my config options from SourceTree. Can you please just confirm this is exactly what you entered to fix the issue?

Regards David
David Barry
2018 年 9 月 18 日
In case anybody else is having this issue, the solution is to set the arguments to $LOCAL $PWD/$REMOTE
Jan
2017 年 1 月 4 日
You can call the built-in comparison tool, buit it is not documented and will be subject to changes. What is the desired output?
In Matlab R2016b:
file1 = which('plot.m')
file2 = which('diff.m')
html = comparisons_private('textdiff', file1, file2);
web(['text://', html])
Look into the source of comparisons_private.m to see more options.
You can find out these methods by starting the profiler and select the "Compare" menu in the editor. Afterwards profile report tells you, which functions are called. As far as I can see, this is not a reverse engineering of Matlab and therefore it is legal.
Rebecca Nakhoul
2020 年 5 月 12 日
0 投票
To customize source control tools to use MATLAB for Diff and Merge, follow the steps described in the MATLAB documentation.
It covers source control tools such as SourceTree Git, Tortoise SVN and Perforce P4V.
カテゴリ
ヘルプ センター および File Exchange で Source Control についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!