[TxMt] SVN?
Ale Muñoz
bomberstudios at gmail.com
Thu Mar 29 23:00:35 UTC 2007
My 0.2 to this discussion (or "Some things I learnt working with
talented people" :)
# Use a staging server.
If you can afford the exact same hardware and software, go for it. It
will pay off in no time. If you can't afford even an "as similar as
possible" server, go for Parallels. But never *ever* test on a live
server.
# Use an automated, one-click deployment tool.
Cal Henderson, in his book "Building Scalable Web Sites", describes
the system they use at Flickr.com. You'd be *really* impressed to see
how their tool looks like (talk about simplicity :)
If building a custom tool looks like too much hassle, take a look at
Capistrano[1]. You'll be glad you invested some time learning how to
use it the first time you deploy a faulty application to a group of
servers and can revert to the previous version in seconds.
# Subversion is your friend. Get to know it.
The amount of things Subversion can do is amazing. Take time to learn
to master it.
Just a tidbit: did you know you can export your working copy to
another location without checking in your changes?[2] This has helped
me countless times when I want to test changes on a remote server
before checking in to the repository.
# Post-commit hooks in Subversion are *powerfull*
Yet nobody seems to use them to their full potential. Some ideas on
what you can do with them:
- Validate your HTML before checking it in. If it does not validate,
don't add it to the repo.
- Compress your JavaScript, keeping a "readable" version of the file.
- Update your Basecamp with commit messages.
- Auto-deploy on commit.
- Run tests on commit (continuous integration[3])
# Use branches.
Branching is "cheap" in Subversion. If you want to "play" with code,
create a branch. Merge only known-working changes.
# Don't be afraid of trivial commits.
100 trivial commits ("Added a comma", "Fixed typo"...) are better than
1 big (and potentially problematic) commit. Version control should be
a part of your workflow, not the end of it :)
Commits are free :)
I guess what I'm trying to say is "know your tools". I couldn't live
without version control right now, and I am a *designer* :) so if you
code for a living you should really invest some time mastering
Subversion.
And one last thought: if you think version control sucks, you are
lacking information. Somebody once said: "If you explain it well
enough, everyone loves version control". I can't remember the quote's
source, but it is spot on ;)
[1] <http://manuals.rubyonrails.com/read/book/17>
[2] <http://svnbook.red-bean.com/en/1.1/re10.html>
[3] <http://en.wikipedia.org/wiki/Continuous_Integration>
--
Ale Muñoz
http://sofanaranja.com
http://bomberstudios.com
More information about the textmate
mailing list