Mar 30, 2008

Cleaning Up Revision Histories

A post in the the bazaar email group described a better approach (than I had been using) to manage merges from personal working branches. For example; If I wanted to commit a change to the project 'Foo', according to the post, I'd do something like this...

$> bzr init-repo foo-branches
$> cd foo-branches
$> bzr branch http://example.com/foo-trunk trunk
$> bzr branch trunk workbranch
$> cd mybranch
$> # hack, commit, hack commit, repeat as necessary
$> cd ../trunk
$> bzr pull
$> bzr merge ../workbranch
$> bzr commit
$> bzr push
What I've done above is to first create a shared repository. I do this because I'm going to be working with multiple branches of the same project. Then I branch Foo's trunk into my new shared repository. Next I branch the trunk (that's in the repository) to my personal working branch, make all the changes and as many commits as I want. When I'm done I go back to the trunk. Pull it to make sure it's up to date. Then merge in my changes. Once I've done that I commit them and push them up to the server.

If you're worried about disk space you can remove the working trees for any branch you're not currently working in.

Inspirational Speeches

My feeds contained a blog post from Sean Tierney in which he links to a couple of excellent speeches, both very much worth taking the time to watch. He also mentions an older post of his about publicly sharing your goals. Which I agree is an excellent idea and easily done with 43Things.com. You can find my recently started list here.

Mar 25, 2008

Modeling Magic

I never dreamed I'd ever come to find business software an interesting domain to study but that's exactly what's happened.

Like it was for many people, I first got interested in programming because of games. In fact I can trace my interest to a specific event; I was about 10 and I was playing a game on an Atari 400 computer and realized I had absolutely no understanding of how it worked. Prior to that moment I thought there was nothing in the world more complex than a light switch but after that moment I wasn't so sure. I had to learn how it worked; was it magic or a light switch?

Well of course it was a light switch, a gazillion of them all packed on to a chip in fact, but while I was learning that I came to a realization, apparently one all programmers make; The only way to demonstrate your understanding of something was to model it in software.

So now I find myself trying to model business processes but I'm not 100% sure there's not a bit of magic in this light switch.

Before Filtering HTTP Method Types

Previously I wrote the post 'Method Not Allowed' which is about how I decided to handle unsupported HTTP request method types in my actions. Today I realized I should DRY up my code and put this logic into a before filter.

Mar 23, 2008

Bzr to Git

I think it's safe to say that the Rails community has decided git is the distributed revision control tool of choice. Unfortunately for me I've been using bzr for the last year or so. Lucky for me it's easy migrate from bzr to git using svn as an intermediary.

svnadmin create --fs-type fsfs /path/to/svn/project
cd /path/to/bzr/project
bzr svn-push /path/to/svn/project/trunk
git-svn clone -T /path/to/svn/project/trunk /path/to/git/project