views:

1022

answers:

6

I am using MATLAB R2008a and I want to know what source control has integration with it. I've heard Visual Source Safe is not so good. Does Subversion have integration with it?

+1  A: 

How about using Subversion? Its pretty good and free and open source!

espais
+1  A: 

Or Git - also open source.

You're correct about VSS - not so good.

duffymo
+1  A: 

On Windows (guessing from your mention of VSS), MATLAB integrates with the Microsoft source control API

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f7-5297.html

(I realise that's a R2009b doc link, but I believe the functionality was similar in R2008a).

So, you need to find an interface between the Microsoft API and your chosen source control system. For example

http://svnscc.tigris.org/

Edric
+1  A: 

I use TortoiseSVN / Subversion with Matlab - there's no integration into the Matlab IDE (not even the overlay icons) but nevertheless it's pretty straightforward to use.

Ian Hopkinson
+7  A: 

I wouldn't worry about the Matlab source control integration. It's convenient, but not necessary.

Every modern source control system has one or more GUIs built for it, which will usually be more powerful than the generic source control GUI that Matlab provides. And most have command line utilities which expose the full power of the system. You can use these by getting them on your system path and then calling them from Matlab with "!". Or you can write your own M-code wrapper functions that call your source control utilities. As a convenience, these can support partial paths by using "which", like so.

function checkin(infile, comments)
file = which(infile);
if ~exist(file, 'file')
    error('Not a file: %s (resolved to %s)', infile, file);
end
cmd = sprintf('cvs commit -m "%s" %s', comments, file);

For external tools, if they make changes to files or dirs and Matlab doesn't see them (e.g. if you're on a network drive that's exhausted its change notification handles), you can use path(path) to force Matlab to rescan.

So, pick your source control system on its own merits (as long as it exposes its functionality in the command line or ActiveX controls), and then wrap it if you feel the need and Matlab doesn't already integrate it. I've worked with CVS, ClearCase, and AccuRev this way, and we've always ended up using the version control tools directly or through custom wrappers instead of the Matlab integration.

Andrew Janke
A: 

To add to Andrew's point, here's a full-featured wrapper to use Git from the MATLAB command prompt: http://manuraghavan.net/?p=22

Manu R