Version Control for Igor Analyses
Fri, 06/27/2008 - 12:13 pm
To some of you this may be a no-brainer, but I started using Subversion (http://subversion.tigris.org/) to address this problem. Subversion is a version control system intended to allow programmers to maintain a repository with a history of all changes to their code, simultaneously accessible and modifiable by multiple users. Different parts of a project can be worked on simultaneously, and reintegrated into the whole, and one can "roll-back" to a previous version at any time.
Subversion's greatest strength is with text files, in which two different versions of a file can be distinguished by saving one copy of the file, and then a list of line-by-line revisions, rather than two whole and mostly similar versions of the file. This saves a lot of disk space, among other things. I realized that when an Igor experiment is saved unpacked, almost all of its components (variables, command history, recreation macros, procedure files, notebooks, but not waves) are essentially just directories of text files. The only "wasted" space in saving multiple versions would be for changes in waves. While this could be substantial, it's certainly no worse than saving a whole new copy of the experiment file.
By placing an unpacked experiment (or a directory of unpacked experiments) under version control, I can have one instance of my analysis, the most updated one, on disk, but roll back to previous versions (stored as a list of changes, on the same disk or a backup server) at any time. This keeps different analysis files that might go together with one another, or with notebooks, etc., all under the same version.
Here are the issues I have identified in using Subversion to provide version control for Igor analyses.
1. Notebooks are recognized as binary files by Subversion, and thus are not given the line-by-line treatment. Change the config file in the Subversion home directory (~/.subversion on Mac) to enable auto-props, and add the auto-prop *.ifn = svn:mime-type=text/ifn. Then notebooks will be treated as text.
2. Subversion doesn't like files with no data fork (Mac only). Delete icon files from Igor experiment folders before importing your project into subversion.
3. All newly created objects will need to be placed under version control. Running svn add * --force, before committing changes, will take care of this. The same applies to newly deleted objects, but you don't really need to delete things in the OS or through Subversion as long as you've deleted it from memory in Igor.
I'm sure there are other issues, but I haven't run into them yet in my testing of this method. If anyone has any insights into this approach to version control for Igor analysis projects, I'd like to hear them. At some point I could even make an Igor procedure with ExecuteScriptText calls, or an XOP, to handle the svn commands.