Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I store a Mac OS X Alias in Team Foundation Server without breaking it?

I'm currently developing an iPhone App and my company uses TFS 2010 for source control.

We're using Team Explorer Everywhere as an Eclipse plugin to handle source control on the Mac and for other projects (like a C++ project we recently did) it works fine.

However it doesn't appear to work for this iPhone App and the main reason appears to be Aliases. It either won't store them at all or it will store them as a regular file or folder, which breaks everything.

Prior to this attempt to move to TFS I was using Mercurial in an impromptu fashion and everything just worked.

Does anyone know how to store things like Aliases from a Mac OS X machine in TFS without breaking them?

like image 636
Tom Kidd Avatar asked Jul 01 '11 16:07

Tom Kidd


2 Answers

Aliases on the Mac OS are a hybrid of a sym link as well as a pointer to the source's File ID. (think of it like a pointer to the inode as well as a sym link to the full path on a traditional unix file system)

It's actually more complicated than that since the implementation of the alias structure depends on the underlying file system. This is all documented in the Overview of the Alias Manager Reference

It really boils down to how TFS 2010 is exposing it's file store to the Mac OS - my guess is that it's a SMB share and that's why your aliases are failing to survive the translation from HFS+ to NTFS storage through a SMB API. Unless you can expose the raw storage as HFS+/AFS and TFA 2010 can intelligently track the file changes, you might be out of luck and have to avoid aliases all together. Relative path sym links might be a more robust solution if you care to try that.

You'll give up all the robustness of alias reconnection on the Mac side, but control over your code changes might be more important. I'd also look into a mercurial or git bridge to TFS 2010 as they work better on the mac and might be a more acceptable middle ground.

like image 93
bmike Avatar answered Nov 16 '22 19:11

bmike


Yes, Team Explorer Everywhere can preserve HFS Aliases. HFS stores Aliases in the file's extended attributes:

% ls -Flas alias
208 -rw-r--r--@ 1 ethomson  staff  69936 May 30 15:19 alias
% xattr alias
com.apple.FinderInfo
com.apple.ResourceFork

Team Explorer Everywhere will store extended attributes when the .tpattributes file is properly configured. To store extended attributes, you will need a line such as:

filename:transform=apple

When this transformation is applied, the local file's data and resource forks are combined into an AppleSingle file, which is then checked in to TFS. When you perform a get on that file from Team Explorer on another Mac computer, the Alias will be correctly preserved. On any non-Mac computer, this flag is ignored and the actual AppleSingle file itself will be downloaded.

like image 34
Edward Thomson Avatar answered Nov 16 '22 18:11

Edward Thomson