cd to the project root
Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.mkd
rooter.sh
rooter.zsh

README.mkd

cd to the project root (identified by the presence of a SCM directory, like .git, or .bzr)

Install

Put something like this in your .zshrc/.bashrc:

. /path/to/rooter.zsh (for the zsh version)
. /path/to/rooter.sh (for the bash version)

This installs the cdr command for use.

Use

$ pwd
/home/yeban/drizzle/drizzle/libdrizzle-2.0/libdrizzle
$ cdr
$ pwd
/home/yeban/src/drizzle/drizzle

Todo

  1. Make it compatible with Bash.
  2. Make it more efficient? Currently, it iterates over each ancestral directory looking for a known SCM directory. Is there a better way?