Productivity, Software SVN choking on TextMate’s metadata files? Not any more!
The Innova Mac Guys, whose number swells daily, tend to use TextMate as our editor of choice. Most of our files live on SMB-mounted network shares from our various Linux development servers.
TextMate has two problems with this scenario: one, refreshes can take a while because TM is rereading every file in the project directory. If you’re on an Intel Mac, and you suffer form this “feature”, try ReMate, which will offer a “Disable Refresh on Window Focus” option.
The other issue is that we use SVN for our revision control. TextMate, when it can’t put setxattr metadata on a file, such as over our aforementioned network shares, it defaults to writing a bunch of .\_filename files everywhere. This is fine, but now running svn status produces a list of garbage: SVN will happily inform you that you have a hojillion .\_filename files lying around that you haven’t told it what to do with, which makes locating the one actual file you want to know the status of pretty painful.
You can make TM stop generating these files by doing a defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1 at a terminal (with TextMate closed), but I find that to be overkill. The metadata stored (caret poisition, bookmarks, what text is folded, etc.) is useful as hell to have.
Or you can also set the svn:ignore property on every single project you have, but that sucks when you’ve got 50-some odd projects. Besides, this isn’t really a project-specific property, it’s more of a global, machine-level, “do not touch” sign on these files.
So, it should come as no shock that SVN has a global and a per-user configuration file, On sane, UNIX-y oeprating systems, you can find your personal config at ~/.subversion/config. The line you’re looking for is global-ignores. My default config had this line commented out, so uncomment it. By default it looks like this:
global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store
Each entry (separated by a space) is a glob to match files against. The default line has all of the standard things a UNIX geek would want to ignore: object files generated by the C compiler, files ending in ~, and even the Mac OS X .DS_Store metadata file.
To get this to cooperate with us, add the glob ._* to the list:
global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .\_*
This will force SVN to ignore those ._filename files when doing svn status, svn add, and svn import, effectively making these commands useful again — especially when working with Windows users whose file managers don’t hide dot-files for them!
General Lessons to be learned from Apple
Apple screwed up.
What’s important here is that they knew it, were smart enough to acknowledge it, and actually fixed (some) of it.
