The easiest way of using git locally to commit to a CVS repository is to have both a git clone of the CVS repository and a CVS checkout of your repository.
Create your git clone of the CVS repository:
git cvsimport -v -a -A /tmp/lame-authors.txt -k -m -d \ :ext:email@example.com:/cvsroot/lame lame
The command above will create your clone of the CVS repository in the current directory which we suppose, for the sake of this discussion, is
If want to specify a directory different than what you're in, then you should add the option
Create a checkout of the CVS repository for CVS work stuff (I'm checking out things under
cvs -z3 -d:ext:firstname.lastname@example.org:/cvsroot/lame checkout lame
This will create your CVS checkout on the directory
/tmp/lame, assuming that you are working under
/tmp, as I do.
Go to your git clone (
/tmp/gitified) and start hacking, committing, etc.
When it is time to send your patches to the CVS repo, you have to:
export GIT_DIR=/tmp/gitified/.git cd /tmp/lame git cherry origin master | sed -n 's/^+ //p' | xargs -l1 git cvsexportcommit -c -p -v
This will automatically check in all the commits that you have made in the previous step.
- First, discard your commits in your git repository, so that you don't get
further problems with
Update your git repository with the current contents of the CVS repo:
cd /tmp/gitified git cvsimport -v -a -A /tmp/lame-authors.txt -k -m -d \ :ext:email@example.com:/cvsroot/lame lame
Update your CVS repository with the current contents of the CVS repo too:
cd /tmp/lame cvs update
Of course, I would prefer a simpler, leaner workflow. If you happen to have one, please let me know.