1 # <a name="Git Plan:"></a> Git Plan:
3 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]] hackaton 2008 at Google, based of the work already done by Derrick Brashear.
5 ## <a name="Background"></a> Background
7 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,
9 - There are cases where the same file has been changed more than once in a given delta.
10 - In those cases, the revisions of a given file in a given delta is not always consective.
11 - 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.
12 - 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.
14 ## <a name="Overview of the process"></a> Overview of the process
16 ## <a name="Set up base Repo"></a> Set up base Repo
18 ### <a name="Prep:"></a> Prep:
20 ### <a name="Process:"></a> Process:
22 #### <a name="(commit 1) Start from IBM 1.0 +"></a><a name="(commit 1) Start from IBM 1.0 + "></a> (commit 1) Start from IBM 1.0 + 3.6 docs
26 - (in a tmp directory) cvs -d:pserver:anonymous@cvs.openafs.org:/cvs -z5 export -ropenafs-stable-1\_1\_0 openafs/doc
27 - Make and change to git\_base directory
28 - untar openafs-1.0-src.tar.gz
29 - move tmp ´doc´ folder into git\_base
30 - untar initial-commit-postapply.tar
33 - git commit -m "Initial IBM source code import\\rDelta initial-20001103" --author="Transarc <afs@transarc.com>"
37 #### <a name="(commit 2) Apply license changes"></a> (commit 2) Apply license changes
42 - Cleanup: rm .rej & .orig
43 - untar 2-postapply.tar
44 - git commit -m "" --author="Transarc <afs@transarc.com>"
48 ### <a name="Patch Fixup"></a> Patch Fixup
50 - Original codebase had bit errors; tarball used for git base does not have them, remove (most of) these fixes from patchsets
54 ### <a name="Repo Fixup"></a> Repo Fixup
58 - Resolve issues into commit 3
59 - Part of the doc tree was not in the initial import
60 - README files were missing
61 - IBM tree has munged tags; cvsps output does not...
62 - Check in IBM tree to CVS, export -kk and use resulting diff -R to make all Revisions in the tree unmunged
72 ### <a name="Issues:"></a> Issues:
74 license changes won´t apply cleanly as initial was from RCS and CVS munged rev vars on checkout
76 ## <a name="Automate patch - branches"></a> Automate patch -> branches
78 ### <a name="Prep:"></a> Prep:
80 ### <a name="Process:"></a> Process:
82 - Clone base repo (git clone git\_base git\_working)
83 - Starting with 3.patch
85 - Create branch with patch/delta name (git checkout -b)
86 - Apply patch (git apply --index)
87 - Commit (-m ´Apply patch X´)
89 ### <a name="Issues:"></a> Issues:
91 ## <a name="Handle binaries"></a> Handle binaries
93 ### <a name="Prep:"></a> Prep:
95 - Find a list of binaries in cvs, search for '^expand\\w+@b|o@'
97 ### <a name="Process:"></a> Process:
101 - Parse file list from patch X
102 - If patch has binary files, git check out branch X
103 - For each binary file, CVS check out listed revision over existing file
104 - Commit (-m ´Adding binaries´)
106 ## <a name="Merge branches into master branc"></a> Merge branches into master branch
108 ### <a name="Prep:"></a> Prep:
110 - Parse patches to make X.msg & X.author
112 ### <a name="Process:"></a> Process:
115 - Merge branch X into master (git merge --squash)
116 - Commit with message & author for patch X (git commit)
117 - ! On failure... stop, and allow for reset
118 - Push master to origin/master
120 ## <a name="Validate and release"></a> Validate and release
122 - Check that checkout of master matches cvs HEAD
124 ## <a name="Handle tags"></a> Handle tags
126 - Determine tag->delta relationship
128 -- [[MichaelMeffie]] - 28 Oct 2008