Filter löschen
Filter löschen

mlDiff.exe not working: missing tmp file

10 Ansichten (letzte 30 Tage)
Marco Restelli
Marco Restelli am 7 Mär. 2022
Beantwortet: Nihal am 23 Jan. 2024
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

Antworten (1)

Nihal
Nihal am 23 Jan. 2024
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

Kategorien

Mehr zu Source Control Integration finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by