5 This is the procedure used to convert the [[OpenAFS]] CVS version control into a git repository. This work was done by Maximilian Cohan and Michael Meffie at the [[OpenAFS]] hackathon 2008 at Google, based off the work already done by Derrick Brashear.
10 The [[OpenAFS]] cvs repository poses several unique and interesting challenges in the git conversion. A custom tool called wdelta, combined with a custom set of commit scripts, has been used since the projects inception. The deltas are effectively patch sets made up of rcs revisions. We need to preserve these deltas and all the history associated with the deltas. Unfortuntunately, the not all deltas were created automically. This leads to some issues,
12 - There are cases where the same file has been changed more than once in a given delta.
13 - In those cases, the revisions of a given file in a given delta is not always consective.
14 - In the cases where there are revision gaps, there could be conflicts when trying to collapse the changes into a single patch for the file.
15 - Also in the cases where there are gaps, it is possible that cvs tags could interleave the revisions of a delta, although it is unknown at this time if such a case exists.
17 ## Overview of the process
19 ## Where the tools are
21 /afs/sinenomine.net/public/openafs/projects/git\_work/
29 #### (commit 1) Start from IBM 1.0 + 3.6 docs
31 - (in a tmp directory) cvs -d:pserver:anonymous@cvs.openafs.org:/cvs -z5 export -ropenafs-stable-1\_1\_0 openafs/doc
32 - Make and change to git\_base directory
33 - untar openafs-1.0-src.tar.gz
34 - move tmp ´doc´ folder into git\_base
35 - untar initial-commit-postapply.tar
38 - git commit -m "Initial IBM source code import\\rDelta initial-20001103" --author="Transarc <afs@transarc.com>"
40 #### (commit 2) Apply license changes
43 - Cleanup: rm .rej & .orig
44 - untar 2-postapply.tar
45 - git commit -m "" --author="Transarc <afs@transarc.com>"
49 - Original codebase had bit errors; tarball used for git base does not have them, remove (most of) these fixes from patchsets
53 - Resolve issues into commit 3
54 - Part of the doc tree was not in the initial import
55 - README files were missing
56 - IBM tree has munged tags; cvsps output does not...
57 - Check in IBM tree to CVS, export -kk and use resulting diff -R to make all Revisions in the tree unmunged
67 license changes won´t apply cleanly as initial was from RCS and CVS munged rev vars on checkout
69 ## Automate patch -> branches
75 - Clone base repo (git clone git\_base git\_working)
76 - Starting with 3.patch
78 - Create branch with patch/delta name (git checkout -b)
79 - Apply patch (git apply --index)
80 - Commit (-m ´Apply patch X´)
88 - Find a list of binaries in cvs, search for '^expand\\w+@b|o@'
94 - Parse file list from patch X
95 - If patch has binary files, git check out branch X
96 - For each binary file, CVS check out listed revision over existing file
97 - Commit (-m ´Adding binaries´)
99 ## Merge branches into master branch
103 - Parse patches to make X.msg & X.author
108 - Merge branch X into master (git merge --squash)
109 - Commit with message & author for patch X (git commit)
110 - ! On failure... stop, and allow for reset
111 - Push master to origin/master
113 ## Validate and release
115 - Check that checkout of master matches cvs HEAD
119 - Determine tag->delta relationship