mlDiff.exe not working: missing tmp file

4 次查看(过去 30 天)
Hi all,
I would like to put simulink models under git version control, and I have found thsi reference
to configure the matlab tools mlDiff etc. as git hooks. I have added to .git/config the following lines:
[difftool "mlDiff"]
cmd = \"C:/Program Files/MATLAB/R2021b/bin/win64/mlDiff.exe\" $LOCAL $REMOTE
[mergetool "mlMerge"]
cmd = \"C:/Program Files/MATLAB/R2021b/bin/win64/mlMerge.exe\" $BASE $LOCAL $REMOTE $MERGED
[merge "mlAutoMerge"]
driver = \"C:/Program Files/MATLAB/R2021b/bin/win64/mlAutoMerge.bat\" %O %A %B %A
and I try to diff a file with
git difftool -t mlDiff HelloWorld.slx
A prompt asks me
Viewing (1/1): 'HelloWorld.slx'
Launch 'mlDiff' [Y/n]? Y
and matlab starts, but then I get en error window with
File C:\tmp\JUxVni_HelloWorld.slx not found
I am using Matlab version '9.11.0.1837725 (R2021b) Update 2' on Windows, and I use git from the cygwin installation.
Any clue about how I could fix this problem?
Thank you,
Marco

回答(1 个)

Hornett
Hornett 2024-1-23
Hello Marco,
It appears there is an issue with the way Git is passing the file paths to the MATLAB diff and merge tools. This can sometimes happen due to differences in path formats between Cygwin and native Windows applications. Here are a few steps you can try to resolve the issue:
  1. Ensure Correct Path Formatting: Cygwin uses a Unix-like path format, which may not be correctly interpreted by Windows applications. Make sure that the paths provided to mlDiff.exe and mlMerge.exe are in Windows format.
  2. Use Native Windows Git: If you're using Cygwin's Git, try switching to a native Windows version of Git, such as Git for Windows. This may resolve any path compatibility issues.
  3. Adjust Git Configuration: Modify your .git/config to use the native Windows path for the temporary files. You can use a shell script to convert Cygwin paths to Windows paths if needed.
  4. Check for Spaces in Paths: If your MATLAB path contains spaces, ensure that the command in .git/config correctly handles spaces. You might need to wrap the entire command in single quotes and the paths in double quotes.
I hope this helps

类别

Help CenterFile Exchange 中查找有关 Source Control 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by