What I Learned Today

Deploying from Subversion via Capistrano is a total pain for me now, after using Git. Subversion is so slow, and I don't want to wait over a minute for it to checkout the repository onto my production box. It takes so long because I have Rails and all my dependent gems in vendor.

I got fed up and dealt with this problem today. What I did was remove all unnecessary files from vendor. This seemed risky, but worked out ok for me. (Note: I'm using git-svn, which is why you see me using git below to delete files.)

find vendor -name test | xargs git rm -r
find vendor -name doc | xargs git rm -r
find vendor -name "*.rdoc" | xargs git rm
find vendor -name "CHANGELOG" | xargs git rm
find vendor -name "TODO" | xargs git rm
find vendor -name "*LICENSE" | xargs git rm
find vendor -name "README*" | xargs git rm

This could probably be done much more efficiently like so:

%w(test doc *.rdoc CHANGELOG TODO *LICENSE README*).each do |name|
  system "find vendor -name #{name.inspect} | xargs git rm -r"
end

Published: 21 Apr 2009