For my Rails and RubyGem projects I’ll run multiple branches plus a trunk. The trunk represents the live, public/production code, and the branches represent new features being developed . So if I’m working on a branch for a feature, and I open a new terminal shell, THAT’s the working folder I want to go to, not the trunk, nor any other branch. Just that one.
Even for small gems and projects where I have no branches, just a trunk, I want quick ways to get to the working folder.  You know, the branch I was just working on two seconds ago.
So, if I have a project (rails app or gem) called wizzo, and I’ve checked out the trunk and some branches into a common folder:
- /path/to/wizzo —trunk
- /path/to/wizzo_feature1 —branch for feature1 (Last touched)
- /path/to/wizzo_feature2 —branch for feature2
OR, if I checkout the trunk and all branches into one folder:
- /path/to/wizzo/trunk —trunk
- /path/to/wizzo/branches/feature1 —branch for feature1 (Last touched)
- /path/to/wizzo/branches/feature2 —branch for feature2
I want an alias
wizzo to take me to
/path/to/wizzo/branches/feature1 if that is where I’m working at the moemnt.
If you want this too, do the following:
$ sudo gem install latest_branch
And for each folder that contains your projects, add the following to your
alias_all_projects --path=~/Documents/rails_apps/ . ~/.project_aliases
And this will generate many wonderful, dynamic aliases for you.
See the latest_branch website for the ins-and-outs, and its helper app
 At work – a non-ruby/rails, billing system on CVS – we do it differently. The trunk is for development of all new features, and production releases are tagged, and also branched for critical fixes. But the above code would be useful for both situations.
 Lucky zsh shell users can do fancy stuff like map folders to
~proj folders, and use autocomplete, such that
cd ~p/t might go to
- Where art thou generator? Summary: click to select UPDATE: Rails Generators within RubyGems support...
- 8 steps for fixing other people’s code Before or after you’re sharing your own code as open-source,...
- RadRails Templates on Trac I have started to cleanup the Ruby and RHTML templates...
- Remote Shell with Ruby I wrote Composite Primary Keys and Dr Nic’s Magic Models...