End Point

News

Welcome to End Point's blog

Ongoing observations by End Point people.

Postgres: Hello git, goodbye CVS

It looks like 2010 *might* be the year that Postgres officially makes the jump to git. Currently, the project uses CVS, with a script that moves things to the now canonical Postgres git repo at git.postgresql.org. This script has been causing problems, and is still continuing to do so, as CVS is not atomic. Once the project flips over, CVS will still be available, but CVS will be the slave and git the master, to put things in database terms. The conversion from git to CVS is trivial compared to the other way around, so there is no reason Postgres cannot continue to offer CVS access to the code for those unwilling or unable to use git.

On that note, I'm happy to see that the number of developers and committers who are using git - and publicly stating their happiness with doing so - has grown sharply in the last couple of years. Peter Eisentraut (with some help from myself) set up git.postgresql.org in 2008, but interest at that time was not terribly high, and there was still a lingering question of whether git was really the replacement for CVS, or if it would be some other version control system. There is little doubt now that git is going to win. Not only for the Postgres project, but across the development world in general (both open and closed source).

To drive the point home, Andrew has announced he is working on git integration with the Postgres build farm. Of course, I submitted a patch to do just that back in March 2008, but I was ahead of my time :). Besides, mine was a simple proof of concept, while it sounds like Andrew is actually going to do it the right way. Go Andrew!

Of all the projects I work on, the great majority are using git now. We've been using git at End Point as our preferred VCS for both internal projects and client work for a while now, and are very happy with our choice. There is only one other project I work on besides Postgres that uses CVS, but it's a small project. I don't know of any other project of Postgres' size that is still using CVS (anyone know of any?). Even emacs recently switched away from CVS, although they went with bazaar instead of git for some reason. Subversion is still being used by a substantial minority of the projects I'm involved with, mostly due to the historical fact that there was a window of time in which CVS was showing its limitations, but subversion was the only viable option. Sure would be nice if perl.org would offer git for Perl modules, as they do for subversion currently (/hint). Finally, there are a few of my projects that use something else (mercurial, monotone, etc.). Overall, git accounts for the lion's share of all my projects, and I'm very happy about that. There is a very steep learning curve with git, but the effort is well worth it.

If you want to try out git with the Postgres project, first start by installing git. Unfortunately, git is still new enough, and actively developed enough, that it may not be available on your distro's packaging system, or worse, the version available may be too old to be useful. Anything older than 1.5 should *not* be used, period, and 1.6 is highly preferred. I'd recommend taking the trouble to install from source if git is older than 1.6. Once installed, here's the steps to clone the Postgres repo.

git clone git://git.postgresql.org/git/postgresql.git postgres

This step may take a while, as git is basically putting the entire Postgres project on your computer - history and all! It took me three and a half minutes to run, but your time may vary.

Once that is done, you'll have a directory named "postgres". Change to it, and you can now poking around in the code, just like CVS, but without all the ugly CVS directories. :)

For more information, check out the "Working with git" page on the Postgres wiki.

Here's to 2010 being the year Postgres finally abandons CVS!

11 comments:

Magnus Hagander said...

If you're a fan of GitHub, you can also use the mirror there - it's at:

http://github.com/postgres/postgres

Devrim Gündüz said...

I'm bored of reading such posts. Project name is PostgreSQL. Not Postgres. You are misleading people. One day, people will start saying "Should I use PostgreSQL or Postgres?"...

I respect to your thoughts regarding project's name, but please stop announcing wrong name for the project.

Regards, Devrim

Jeff Davis said...

Thank you, Peter, and others for your work establishing a useful git mirror and making it possible to transition when the time comes.

If nothing else, this makes patch review *much* easier.

Chris said...

I'll be interested when it comes to release time, how you figure out that stuff. I don't have a clear picture in my head of how that works just yet, hopefully you'll clear it up for me ;)

Anonymous said...

A couple of the BSD projects (NetBSD, OpenBSD) are using CVS, and those are quite a bit bigger than postgres, even.

OpenBSD is even actively investing in CVS with their OpenCVS project. I'm not sure about the wisdom of that, though ;)

An important reason for NetBSD (and probably OpenBSD as well) to keep using CVS is because that is currently about the only VCS that doesn't have a busload of dependencies (python for bzr and hg; apr, sqlite and neon for subversion; perl and expat for git) that you need to install. This allows them to keep their "base installation system" relatively small. (it is a requirement that you can fetch the sources to the system without installing third-party software)

Of course, for the BSD projects a BSD license is preferable, so GPLed software has an added disadvantage there. I really wish there was a good, minimal, BSD-licensed and easy to use VCS system :)

Robert Treat said...

"There is little doubt now that git is going to win. Not only for the Postgres project, but across the development world in general (both open and closed source)."

I think this speaks to the insular nature of the Postgres development community. You may not think so, but I have many doubts that git is going to win in the development world in general; Bazaar has a huge boost from Launchpad, and there are several very large projects using that infrastructure, so I don't see it going away. Mercurial also seems to be picking up steam with services like http://bitbucket.org/ now being available, and some of the corporate developers I have talked with seem to favor that communities tone over that of git. While I like git and am very happy with github, I think we're a long way off from seeing them as "the winner", and it's probably more likely we will never see a winner. If it were up to me, I'd make both a bzr and hg mirror of the postgres source code; there's no reason not to try and reach out to other developer communities.

bignose said...

> Even emacs recently switched away from CVS, although they went with bazaar instead of git for some reason.

You cover a major reason to prefer Bazaar:

> There is a very steep learning curve with git, but the effort is well worth it.

With Bazaar, the learning curve is gentle, and the result is well worth it.

simon@2ndQuadrant.com said...

I've been using git for most of the development of Hot Standby. It's fast for big patches and has some cool features for when you screw up. It's relatively simple to learn, once you've got your head round the concepts. I would prefer it if we used git for Postgres; it's better than SVN, though that is good also.

Greg Sabino Mullane said...

Anonymous: Good point, I forgot about the *bsds non-keeping-up-with-the-times and cvs. :) I'm not sure I'd classify perl as a dependency as it's the rare system that doesn't have it installed, but expat I suppose is one, although hardly a reason to avoid git over cvs. I'm with you on the GPL front: more BSD, less GPL.

Greg Sabino Mullane said...

Robert Treat opines:

"I think this speaks to the insular nature of the Postgres development community." Au contraire, Robert, my experience is across many other open source projects as well as many clients that are using it. Clients these days are coming to us already using git internally, rather than us having to sell them on it. :)

I stand by my comment as git being the winner.

Greg Sabino Mullane said...

Chris:

"I'll be interested when it comes to release time, how you figure out that stuff." What stuff, exactly?