Tuesday, January 8, 2008

USB Stick Development

Lately I have been trying to do more software development outside of work, namely my Project Spedini, and that has lead me to the problem of maintaining two development environments and a common code base. I do most of my personal development at home on my iMac, but often want to view what I have been working on at work on my Windows machine. The main problem I was having was the keeping the code synced.

Initially I just copied the code back and forth to my new 1GB USB stick, hoping I remembered to copy the latest changes down before doing any work, but this quickly got tiresome. I thought about using one of my unfinished Google Code project's Subversion repository, but I didn't want to mix projects and I have no immediate need/desire to open the source up for the project (at least not until I have gotten it a whole lot more stable). My next thought was to host a Subversion repository at home ... which would be fine when I am there, but I didn't enjoy the idea of having to expose my home PC to the Internet without a better need.

It just so happened that the same day I was thinking about this, I stumbled upon this blog entry (via DZone I believe). While reading through the comments I had the thought to just put the repository on my USB drive. Its not a perfect solution, but it will fit my needs very nicely. Since Subversion repositories can be accessed directly via the file system without the need for a full fledged server, this was actually very easy to setup. The only problem was setting up the initial repository. For this you need access to the svnadmin binaries or something like TortoisSVN. In either case, I created a new repository in a folder on the USB drive and then did a simple checkout with my client to the repository with the pattern: "file:///

" ... so mine at work is "file:///E:/dev/svn/trunk/". Done and done. Now I have a personal repository, allowing me to keep local working copies on my various machines and one central place to manage the code and version-ing.

Some links I found useful:
****

One issue I ran across when using my USB drive between my Mac and my Windows machine at work .... Mac OS X's file explorer Finder creates numerous hidden files all over your file system to help it manage per-folder preferences, files that have been moved to the trash, etc. This normally isn't a problem b/c on my iMac I can't see them, they don't take up very much space and the benefit outweighs any small drawbacks. That is, of course, unless you are using a USB drive between and Mac and a non-Mac.

These small files are visible on my Windows machine (although "hidden" and starting with a ".", I am sure I can get to them on my Mac via a shell, but normally I don't so its fine). This is especially annoying when moving directories of files back and forth. You end up with tons of .DS_Store files all over the place. Not only that, but since the Mac doesn't actually remove the files when you move things to the Trash .... the usable space on the USB drive goes down over time unless you remove the hidden files and/or clean out your Trash on the Mac with the USB stick plugged in.

I have searched and have been unable to find a solution to either of these problems. I thought I had found one with this Apple documentation page, but evidently it only applies to network drives. Luckily, by keeping my code in the Subversion repository and not navigating it by hand, I won't have .DS_Store files randomly in my code base, but I still get them in my other folders.

If anyone knows a workaround for this, I would love to hear it.

No comments: