« My Kimble Moment with Ducks and Superducks in Rocksmith (PS3) | Main | Mettigel Rising »

Importing CVS into git on Mac OS X

It's pretty simple, but you need to set some git config variables to make the import go smoothly.

First up, you need cvsps. The currently stable cvsps version 2.1 works better with the git version 1.7.4.4, that Xcode gave me, so download it.

Building cvsps is just make and installing into /usr/local is just sudo make install

Then get your CVSROOT environment variable set properly.

Finally you need to configure some variables in git, as they may be set to values, that preclude a working import. Here 's a shell script, which isn't foolproof, but useful enough.

#! /bin/sh

rm -rf .git

#
# my settings
# core.autocrlf=input
# core.safecrlf=true
#

old_autocrlf=`git config --get core.autocrlf`
old_safecrlf=`git config --get core.safecrlf`
old_encoding=`git config --get i18n.commitencoding`

git config --global core.autocrlf  false
git config --global core.safecrlf  false
git config --global i18n.commitencoding MacRoman

git cvsimport $*

if [ "$old_autocrlf" != "" ]
then
   git config --global core.autocrlf "$old_autocrlf"
else
   git config --global --unset core.autocrlf
fi

if [ "$old_safecrlf" != "" ]
then
   git config --global core.safecrlf "$old_safecrlf"
else
   git config --global --unset core.safecrlf
fi

if [ "$old_encoding" != "" ]
then
   git config --global i18n.commitencoding "$old_encoding"
else
   git config --global --unset i18n.commitencoding
fi

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on February 15, 2012 1:04 PM.

The previous post in this blog was My Kimble Moment with Ducks and Superducks in Rocksmith (PS3).

The next post in this blog is Mettigel Rising.

Many more can be found on the main index page or by looking through the archives.