Team MAGIC, or “The Magicians” (as they are known within Alley) found themselves with a rare opportunity to link their in-person retreat with the American Alliance of Museums yearly conference in New Orleans. Team Magic has worked on many museum projects and a few members of the team were speaking at the conference last year. So, instead of choosing a random city somewhere in the continental United States of America, the Magicians set their sites on the birthplace of jazz.
It’s possible to run a Subversion repository inside a Git repository, and desirable in one particular case for us. WordPress VIP uses SVN to manage deployments, and we use Git to collaborate on projects internally. We don’t push our work to VIP until it’s ready to deploy, but we need multiple people to be able to commit to SVN. So our Git repository is an entire WordPress installation, and the custom theme is an SVN working copy checked out from WordPress VIP’s repository. The whole SVN tree, including .svn/ files, is committed to git.
What makes this possible is that SVN stores all its metadata in .svn/ directories, except for authentication information, which is stored in your home directory (~/.subversion to be specific), but there is one wrinkle—Git will not commit empty directories, and .svn/tmp directories are typically empty. There are dozens of these directories in our theme, but there’s a quick way to solve that problem:
|for dir in $(find . -name “$basedir“ -type d); do|
|git add “$dir“;|
Invoke the script like ‘bash add-empty-dirs.sh tmp’, and the commit the results to Git. When your team members check out the Git repository, it will come with a fully loaded Subversion repository ready to use, so long as they have credentials on the remote SVN server.