gc-utils – interaction between cvs and git

The version control system GIT is powerfull but not yet widely used. In everyday life programers usually have to deal with centralized VCs, in particular CVS.

If you have to use CVS but want to get the advantages of GIT, you usually will import a CVS repository into GIT using git-cvsimport. Dealing with the cvs import and export scripts of GIT is pretty straight forward but yet a more or less complex task. To make things easier I wrote a small set of scripts, making the daily work with GIT and CVS easy and less complicated.

The toolset is called git-utils. It help you with importing an CVS into a GIT repository and keeping them up to day as well as commiting back into the CVS.

To install the toolset, download it. Then run:

$ tar zxvf gc-utils-master.tar.gz
$ cd gc-utils
$ make prefix=/usr install

You can now use gc-import, gc-update and gc-commit. Furthermore man pages are available. The toolset is available under a BSD/MIT License.

If you find the tools usefull, please drop a comment.I wrote gc-utils as I want to track a lot of projects from the company I’m working on in GIT. As the company just uses CVS I deal a lot with CVS and GIT everyday. Specifing the CVSROOT and the GIT_DIR (or the -w option of git-cvsexportcommit) was always pain. Therefore to keep things simple I wrote the utils, which I know use daily. They should on every UNIX system, as I tested them with ash, bash, tcsh, pdksh, ksh, zsh.

If you want to get into the details of gc-utils, here is a short description what the scripts are doing.
Usually if you want to interact with CVS you need a valid CVS working copy of the project you want to use as well as an GIT import. To update you GIT repository you always have to specify the CVSROOT. If you want to commit you have also to specify where to find your working copy.

To make things easier, gc-utils the cvs repository into a git repository and then checks out a working copy of the cvs into a subdirectory called .cvs. If you run gc-update it takes the information from the CVS/Repositoy and CVS/Root file to determine your CVSROOT, so you donnot have to specify them yourself. A gc-commit will cause the .cvs working copy to get patched with patches from the GIT repositoy. You can use the -c switch to automaticly commit. For sure, gc-commit doesn’t help you if something went wrong, but will give you the output of git-cvsexportcommit.

gc-commit needs a valid sha1 identifier of the commit to export. Further versions of git-commit will pick them up itself if you want it.

If you change something yourself, please contribute back by sending me patches to sn_ (at) gmx (dot) net or dsp (at) php (dot) net.

Leave a Reply