Command line Finder labels
Earlier today, whilst reading Omni Group’s Mac OS X dev list, I saw someone remark that they didn’t like the fact that Subversion doesn’t preserve Finder labels.
Helpfully, of course, Subversion allows you to set arbitrary, versioned, properties on your files, so it’s actually pretty easy to store the Finder labels and retrieve them when you want them. Or it would be if there were any command line tools that could read and write them.
Well there are now (download the source code).
Once you have that installed, it’s just a matter of doing
svn-save-labels
to save your Finder labels as Subversion properties (a change that you can then commit to your repository), or
svn-restore-labels
to restore them after an update.
Or you can do
getlabel myfile.txt
to see the colour of a label, or
setlabel myfile.txt red
to change its colour to red.
The getlabel and setlabel programs are provided with man pages. The Subversion scripts are not, but they should be self-explanatory anyway.
It would be nice if you could get subversion to automatically do stuff before committing and after checking out. You could then make this kind of thing automatic. It would also help for the case where you want a file encoded in UTF-16, say, but want it in the repository as UTF-8 so that it's not considered binary (although this might not be the best solution for encoding issues). Same goes for binary NIB files; you could have them stored in the repository as text but on disk in a binary format.