Moving from Subversion to Git
I just finished moving all our repositories from subversion to git. There is lots of documentation on the web, but none of it ties everything together. Specifically, once you get your subversion repository including all branches and tags imported into a local copy of git, how do you push your git repository including all branches and tags to a remote git server? This was important to us because we have ongoing work in some branches which are not ready to be pushed to trunk yet.
I started out by following the excellent instructions at http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way to setup our own git repository. Follow these instructions and create a simple git repository with only a couple of files to make sure it works and become familiar with it. At this point, you have a working central git repository but you are not yet ready to import your subversion repository. If using github, you can skip this step.
Next, go grab git2svn from github. This will download an entire subversion project, including branches and tags, into a local git repository. Depending on the size of your codebase and number of branches/tags, etc, this may take a while. Our smaller projects took about 10 minutes. Our larger project took almost an hour. It differs from git-svn in that it converts anything in subversion tags to actual git tags.
Now for the magic of pushing your local git repository imported from subversion to the central git repository your team will use. At this point, you should have a working central/remote git repository you are going to use.
Inside the root of your local git project, run these commands, replacing everything which is in caps.
git remote add origin git@YOUR_SERVER_HOSTNAME:YOUR_PROJECT_NAME.git
git push origin master:refs/heads/master
After this runs, you have only pushed the trunk to the remote repository (now called master). You will also want to push all your tags and branches. With git, you have to explicitly push your tags.
git push --tags
And now for the branches. This was the only piece I could not find on the interweb. This is achieved by the command
git push --all
The –all command per the documentation specifies that all refs under $GIT_DIR/refs/heads/ be pushed rather than naming each ref to push.
That should be all there is to it. Our other developers were able to clone the newly minted git repository and start developing where they left off on their branch with the command:
git clone git@YOUR_SERVER_HOSTNAME:YOUR_PROJECT_NAME.git
git checkout -b local_branch_name --track origin/remote_branch_name
In: development, howto, software · Tagged with: git, subversion
Mephisto to WordPress, part 1
I finally was able to get the old blog content moved from mephisto to wordpress. Trying to find the time to do it was the most difficult thing. Some of the formatting came out weird and I did not import any of the comments. For me, no big deal. This blog has been mostly ignored but, I swear to myself I’m going to start posting more quality content. We’ll see. Will post mephiso to wordpress script I used soon…
Getting git +svn branches to follow remote branch
Andy Delcambre and Robby Russell both have excellent articles about getting up and running with git as an subversion client.
The one thing that had been getting me was the fact that the branch I created locally did not always stick to following the remote branch. It would start out that way, but once I checked out the master branch again, it would not always and definitely not consistently point toward the remote branch once I re-checked out my branch.
I finally figured out that the local and remote branch must be named differently. The character case matters! So if I had a remote branch of ITR-FOO and a local branch of itr-foo, it would loose track of the remote branch. The easy solution is to name the branches differently by using a “-” remotely and a “_” locally for names or just name the branches differently. Now, I use ITR-FOO remotely and itr_foo locally, or shorten the local name to itr_promos if I am using ITR-PROMOTIONS remotely.
For merging branching, using git is so much simpler, even if it is very retarded sometimes.
In: Uncategorized · Tagged with: git svn development
MileMeter has Launched
After a year of work, my company MileMeter has launched. We sell auto insurance by the mile with no vehicle tracking devices involved.
A big hats off to Chris Gay for working so hard for so many years so that we can could get to this point. Insurance rules had to be changed and it was difficult for many people to see the benefit selling insurance this way.
We are also one of very few, if not the only insurance company powered entirely by Ruby It certainly gave us an advantage as we were able to get a robust, well tested application out the door so quickly.

In: Uncategorized · Tagged with: milemeter ruby launch
ruby-mysql-osx
I keep having to look this up…..
sudo env ARCHFLAGS=“-arch i386” gem install mysql — —with-mysql-config=/usr/local/mysql/bin/mysql_config
In: Uncategorized · Tagged with: ruby mysql osx
Pradipta’s Rolodex
I woke up this morning to a 40+ thread of emails which originated by a recruiter sending 416 people job posting, all via TO:
It quickly turned into a somewhat fun conversation with lots of people and jokes. Rather quickly a google group named Pradipta’s Rolodex was created. Also followed was a Wikipedia entry (quickly deleted by Wikipedia admins), a FaceBook group, at least one domain registration as well as posts to Digg, Reddit and others.
Oh, the friday fun…..
In: Uncategorized · Tagged with: recruiter email pradipta rolodex
Rspec Test render(:nothing = true)
I was trying to test one of my controllers was successfully hitting the render(:nothing = true) block. I could not find anything specifically in the API which handled this senario, so I ended up using have_text with a space as an argument.
@response.should have_text(" ")
In: Uncategorized · Tagged with: rspec rails test
Vote for Milemeter at AWS Startup Challenge
Go vote for Milemeter at AWS Startup Challenge and keep me gainfully employed!
We are proud to be 1 of 7 Finalist for the Amazon.com AWS Startup Challenge and will give our presentation next week at Amazon.com HQ. Milemeter is an innovative insurance start-up that will offer “auto insurance buy the mile”.
Update: Congratulations to Ooyala for winning the AWS Startup Challenge.
In: Uncategorized · Tagged with: milemeter aws startup-challenge
Quote of the Day
This one is from my 4 year old. While walking through the womens department with my wife, they come across the bras. There was one particularly large white bra hanging on the end of a rack. Tommy stopped and studied it for a minute then proclaimed “Look mommy, that’s where the penguins live”.
In: Uncategorized · Tagged with: quotes
Testing private and protected methods with ruby
When I have to test my protected and private methods in ruby, I make the methods public for the scope of the test.
MyClass.send(:public, *MyClass.protected_instance_methods)
MyClass.send(:public, *MyClass.private_instance_methods)
Just place this code in your testing class substituting your class name. Include the namespace if applicable.
In: Uncategorized · Tagged with: ruby testing
