Jump to: navigation, search

Fetching the code

Fetch the code

mikal really likes having all the code on his machines, it makes it easier to jump across to other projects and make complicated changes with a minimum of fuss. There's even a simple script to do that. First off, make a directory in your homedir called "src". Then chuck this script into a file in that directory:

#!/bin/bash

USERNAME="mikalstill"

for repo in `ssh review gerrit ls-projects` ; do
    mkdir -p $(dirname $repo)
    if [ ! -d $repo ] ; then
        echo "Cloning $repo"
        git clone git://git.openstack.org/$repo $repo
        (cd $repo; git review -s)
    else
        echo "Updating $repo"
        (cd $repo; git remote update)
    fi
done

Change the username to your gerrit username of course. This script assumes that you have gerrit setup in ~/.ssh/config. mikal's ssh config for that machine looks like this:

# Openstack
Host review.openstack.org review
  Hostname review.openstack.org
  Port 29418
  User mikalstill

chmod the script as you usually would, and then run it. Its going to take a while, last time mikal checked, a checkout of the codebase took 1.4gb of disk on his machine.