Seabiscuit Development with Git-svn

Android development for the worklist currently requires using subversion, and currently that requires developing on your local machine and then syncing your work up to your sandbox on dev.worklist.net so it can be reviewed before being submitted. It turns out that this use case is exactly what git was designed to solve, and it just so happens that git is a pretty fantastic subversion client as well. Here I (Brad) will be describing the steps for setting this up here so it works with the worklist's code review system. A lot of this is a little too consice right now, and assumes you know git usage pretty well. Hopefully in the future I'll improve it to be more explicit in explaining how to use git.

Setup on the dev server
To begin with you'll need to get a bid accepted for a seabiscuit job and then check out seabiscuit on your dev sandbox. You'll only need to do these steps once, after that you should be able to keep using the same checkout. Once you're bid has been accepted it will have created a svn checkout for you. If your job is (for example) 17922, then it will be in ~/public_html/seabiscuit_17922. Substitute your job_id for 17922 in the directions below.

ssh dev.worklist.net cd public_html git svn clone https://svn.worklist.net/svn/repos/seabiscuit rm -rf seabiscuit_17922 ln -s seabiscuit seabiscuit_17922 cd seabiscuit svn checkout https://svn.worklist.net/svn/repos/seabiscuit. --force

What this has done is created a single working copy that can work with either git or svn. Next you'll need to clone the repo on your local development machine as well.

Setup on your local workstation
This is the machine you'll be using to do most of your android development. It should have the android sdk installed, and if you like, eclipse and the eclipse adt plugin.

First clone from your sandbox. I've called the origin 'sandbox' fore ease of use later, but if you like, you can leave out the '-o sandbox' part and let it be called 'origin' instead.

git clone -o sandbox ssh://dev.worklist.net/home/brad/public_html/seabiscuit

Next you'll probably want to hook up git-svn for this working copy as well, so add the following 3 lines to the bottom of seabiscuit/.git/config: [svn-remote "svn"] url = https://svn.worklist.net/svn/repos/seabiscuit fetch = :refs/remotes/git-svn

Now you should be able fetch from either your sandbox or from svn directly: cd seabiscuit git fetch sandbox git svn fetch

Develop your patch
git commit -a git svn fetch git rebase git-svn

Push your change to your dev server sandbox
git push sandbox master:task-17922 --force

ssh dev.worklist.net cd public_html/seabiscuit git svn fetch svn up git checkout task-17922

NOTE: before going for a code review (or setting the status to FUNCTIONAL) be sure to move the .git file out of the folder. If the .git file is present Worklist will send a failure message telling you "Sandbox contains 'not-included' files" ... Alternatively leave the worklist subversion checkout of the job there and just apply a patch (from git diff) to that.