Clear Filters
Clear Filters

mlDiff.exe not working: missing tmp file

12 views (last 30 days)
Marco Restelli
Marco Restelli on 7 Mar 2022
Answered: Nihal on 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

Answers (1)

Nihal
Nihal on 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

Categories

Find more on Source Control Integration in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!