Importing Docs CVS modules to git

This document demonstrates how to turn a Docs CVS module into a  repo.

Create author file
Get the script found here: http://pfrields.fedorapeople.org/scripts/authors-from-fas2-group.py

Make sure you have the  package installed: su -c 'yum install python-fedora'

Run the script: python authors-from-fas2-group.py

Provide your FAS username and password, and the group name. You will also need to run it again with the group name. Use the  command to copy both sets of results (in any order) to a single file.

Getting started
Whether you're working with branched or non-branched CVS modules, you obviously need to install : su -c 'yum install git-all'

Then make a directory for your new git repository: mkdir -p &lt;GITREPODIR&gt;

Non-branched CVS modules
Run  for the module. Substitute the directory you just made for &lt;GITREPODIR&gt;, and the module name (like "foo-guide") for &lt;MODULE&gt;.

git-cvsimport -d :pserver:anonymous@cvs.fedoraproject.org:/cvs/docs \ -S docs-common -v -C &lt;GITREPODIR&gt; -u -p x -a -A ~/authors.txt &lt;MODULE&gt;

This could take quite a while, depending on the size of the repository and the speed of your network connection.

Branched CVS modules
Branched CVS modules have a directory for each release of Fedora (i.e. F-7, F-8, and so on). To convert them, do this:

 Create the master branch from the contents of the devel CVS module directory: git-cvsimport -d :pserver:anonymous@cvs.fedoraproject.org:/cvs/docs \ -S docs-common -v -C &lt;GITREPODIR&gt; -u -p x -a -A ~/authors.txt &lt;MODULE&gt;/devel 

Look for tags that reveal where versions were branched. If you're lucky, you'll see tags like, or something to that effect. git tag

If you don't, that means no one tagged the source at the appropriate point. Unfortunately, Docs CVS never had any enforcing build system like the Package CVS. However, you can do a little sleuthing in a document's content, or in the CVS history, to find out the date when it was branched. Then find the git commit message for that branching, or the last one before that date, and use that as your branch point.

Use the tag or the date to create a new branch in your local git repository. Use a branch name like f for the &lt;BRANCH&gt;. git checkout -b &lt;BRANCH&gt; &lt;TAG_NAME_or_COMMIT&gt; 

You are now on the new branch automatically. Do a  from the appropriate CVS branch directory -- &lt;CVS_BRANCH&gt; might be F-8 for instance. Don't forget the  option in this command! git-cvsimport -d :pserver:anonymous@cvs.fedoraproject.org:/cvs/docs \ -S docs-common -v -C &lt;GITREPODIR&gt; -u -p x -a -A ~/authors.txt \ -o &lt;BRANCH&gt; &lt;MODULE&gt;/&lt;CVS_BRANCH&gt;

Repeat the above steps for each Fedora release that has a branch directory in CVS. Make a new git branch for each! 

Now you're ready to use this content for your new repository.

Pushing a new branch
If you need to push the results of the previous procedure to an existing repo, make sure you are still on the new branch with the  command. You must have commit rights to the repository in question, which you should have if you used a  protocol to check out the repository. Then push with this command, substituting the branch name for &lt;BRANCH&gt;: git push origin &lt;BRANCH&gt;