Saturday, September 3, 2011

Waverous is now using Git

I finally sat down, rolled up my sleeves and converted Waverous to a Git repository on Google Code. There were a few things that needed extra attention:

1) I used John Albin's instructions on converting a Subversion repository to Git. It provided the most complete way of doing it. I had to do some detective work to figure out the names and emails of some previous committers, but in the end I had a repository with all the data I wanted including all branches and tags.

2) Getting all branches to the remote was not obvious, so I just did some rectangle editing in Emacs:

git checkout AUTOCONF_TWO
git checkout CONSTANTS
git checkout FLOATSUSPEND
git checkout HEAD -> origin/master
git checkout INLINEPC
git checkout UNSAFE_OPTS
git checkout WAIF
git checkout WROGUE
git checkout avalon181
git checkout demacrofication
git checkout demacrofication@233
git checkout experimental_automake
git checkout experimental_reorg
git checkout master
git checkout pavel
3) Then I pushed everything to Google Code:
git push googlecode --all
4) I found the tags didn't make it up either. This was another step:
git push --tags
The one thing I don't like, so far, is I have to maintain a .netrc file with my Google Code password, and when I git clone the repository I have to edit out my username@ from the URL. But after that everything seems to work fine, though git push just returns "Repository up-to-date" without telling me anything happened. So, from the top:
# clone repository created from John Albin's instructions
git clone  ~/new-bare.git waverous

# add the new remote per Google's instructions
git remote add googlecode https://code.google.com/p/waverous 

# check out all branches from my local repository
git checkout AUTOCONF_TWO
git checkout CONSTANTS
git checkout FLOATSUSPEND
git checkout HEAD -> origin/master
git checkout INLINEPC
git checkout UNSAFE_OPTS
git checkout WAIF
git checkout WROGUE
git checkout avalon181
git checkout demacrofication
git checkout demacrofication@233
git checkout experimental_automake
git checkout experimental_reorg
git checkout master
git checkout pavel

# push all branches to Google Code
git push googlecode --all 

# push all tags to Google Code
git push --tags

# Clone and push the wiki on Google Code as a new Git repository
git clone https://code.google.com/p/waverous.wiki
cd waverous.wiki
svn export --force http://waverous.googlecode.com/svn/wiki .
git add .
git commit -m "Conversion of Waverous's wiki documentation to Git."
git push origin master
Overall this was a dumb brute force approach, but it got everything done.