- 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.
- 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.
- 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.
- 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.
mlDiff.exe not working: missing tmp file
10 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
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:
I hope this helps
0 Comments
See Also
Categories
Find more on Source Control Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!