Archive for March, 2012

Converting CVS Repos to Git Repos

Friday, March 2nd, 2012

gitLogo_vert.gif

This morning I wanted to try to get some of my CVS repos converted to Git so that I could have the complete repo on my laptop and not have to worry about internet connectivity. I'm a big fan of CVS, and it's simplicity, but Git is the clear next-generation of CVS, and it doesn't need the connection to the server that CVS does.

Recently, I'd read that there was a simple git command: git cvsimport that would convert a repo, and I just had to try. The first thing was that I needed to have a program called cvsps. This is some other tool - not part of CVS, not part of Git, that I needed to get. I realized this as I tried to convert my first repo, and failed saying it couldn't find this app. So first things first, get the tools I need.

Getting cvsps

A simple google search revealed that the source code for cvsps was held in a very simple web site: http://www.cobite.com/cvsps/. I downloaded the latest stable code, and read the README. It's a simple make; make install, and I'm on my way:

  $ cd cvsps-2.1
  $ make
  $ sudo make install

The cvsps executable is now in /usr/local/bin and /usr/local/share/man. That's all we need - over and above Xcode 4.3 and it's command line tools (cvs, git).

Get a Local Copy of the CVSROOT

While I've read that this can be done using a remote pserver $CVSROOT, it's a good idea to just get a local copy of the complete CVSROOT to work from. Since I'm in a stable state with that, it was pretty easy to copy it to my TimeMachine external drive:

  $ cd /Volumes/Reststop
  $ scp -r frosty:/usr/local/CVSroot .

It only took a few minutes, and now I've got all the "source material" I need.

Migrate a Single CVS Repo

The process is pretty simple - you have to act as if you're starting a new git repo, but instead of the git init command, you issue the git cvsimport command. It's got a few arguments, but it's pretty simple to use.

For this example, I'm calling the new Git repo the same name as the old CVS repo, but I'm guessing if you want, you can change the names.

  $ cd git
  $ mkdir MyProj
  $ cd MyProj
  $ git cvsimport -p x -v -d /Volumes/Reststop/CVSroot MyProj

At this point, you have a new git repo but the origin is not set, so it's not "going" anywhere if you try to push it. Since I'm using gitosis on my home git server, it's a simple process to update that to add in the project(s) I'm migrating into the proper groups, and then push those changes up to the server before I try to set the origin of the new git repo.

Setting the Origin

Assuming that you have the server set up, and it could be that you're using GitHub and not gitosis, then all you need to do is to set the origin and push it up:

  $ git remote add origin git@git.myplace.com:MyProj.git
  $ git push origin master:refs/heads/master

Final Steps

It's possible to now go in and mess with the git config to set the master right, but I've found is just as easy to remove this new repo, and clone it again from the server. If I got it right, the history will be there, and I'll be sure it works. If not, I can start over. Simple.

It's been a lot of fun getting these guys over to git. Now I can use all the tools and fun I've had with git in the last year to these projects. Very nice!

Wow! Today I was Fired

Thursday, March 1st, 2012

cubeLifeView.gif

I was fixing a production problem that the Unix Admins hadn't remembered to fix after the last kernel update, and my Boss asked to see me. I asked him to hold on a second to make sure that I had the production systems back up and emails sent, and then I followed him. Right past his office.

I was going to say "You takin' me out back to whack me?", but as we turned the corner, it was clear that, in a way, that's exactly what he was doing. I was lead into the room with an HR lady with a folder, and it was clear - I was being fired! Wild.

The reason was lame - I was unhappy. He elaborated to say that eventually I was going to leave or they were going to have to fire me, so do it now and get it over with. Seems a little wild given that less than two weeks ago, I got a $75,000.00 bonus check. Hmmm… could it be that I was looking and they found out?

Seems so.

I had a lunch meeting with a friend - totally unrelated to the search, but it could have look suspicious. Also, a clumsy recruiter called me at work - bone-head move, but it could have exposed me. Also, there's the very real possibility that someone blabbed on me. The Chicago finance industry is tight-nit, and it's happened to me before, so I know it can happen.

So it goes. Thankfully, I have a few things to look at, and I'm sure I'll be employed soon, and that's OK with me. This was not the place for me long-term. Too many people that are in the wrong jobs.