reorg: remove the AFSLore subdirectory
[openafs-wiki.git] / OpenAFSCVSToGitConversion.mdwn
1 # <a name="Git Plan:"></a> Git Plan:
2
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]] hackathon 2008 at Google, based off the work already done by Derrick Brashear.
4
5 ## <a name="Background"></a> Background
6
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,
8
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.
13
14 ## <a name="Overview of the process"></a> Overview of the process
15
16 ## <a name="Where the tools are"></a> Where the tools are
17
18 /afs/sinenomine.net/public/openafs/projects/git\_work/
19
20 ## <a name="Set up base Repo"></a> Set up base Repo
21
22 ### <a name="Prep:"></a> Prep:
23
24 ### <a name="Process:"></a> Process:
25
26 #### <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
27
28 - (in a tmp directory) cvs -d:pserver:anonymous@cvs.openafs.org:/cvs -z5 export -ropenafs-stable-1\_1\_0 openafs/doc
29 - Make and change to git\_base directory
30 - untar openafs-1.0-src.tar.gz
31 - move tmp ´doc´ folder into git\_base
32 - untar initial-commit-postapply.tar
33 - git init
34 - git add .
35 - git commit -m "Initial IBM source code import\\rDelta initial-20001103" --author="Transarc &lt;afs@transarc.com&gt;"
36
37 #### <a name="(commit 2) Apply license changes"></a> (commit 2) Apply license changes
38
39 - Apply 2.patch
40 - Cleanup: rm .rej &amp; .orig
41 - untar 2-postapply.tar
42 - git commit -m "" --author="Transarc &lt;afs@transarc.com&gt;"
43
44 ### <a name="Patch Fixup"></a> Patch Fixup
45
46 - Original codebase had bit errors; tarball used for git base does not have them, remove (most of) these fixes from patchsets
47
48 ### <a name="Repo Fixup"></a> Repo Fixup
49
50 - Resolve issues into commit 3
51   - Part of the doc tree was not in the initial import
52   - README files were missing
53   - IBM tree has munged tags; cvsps output does not...
54     - Check in IBM tree to CVS, export -kk and use resulting diff -R to make all Revisions in the tree unmunged
55 - Store commit 3 diff
56 - Stash commit 2
57 - Reset to commit 1
58 - Apply commit 3 diff
59 - Amend commit 1
60 - Reapply commit 2
61
62 ### <a name="Issues:"></a> Issues:
63
64 license changes won´t apply cleanly as initial was from RCS and CVS munged rev vars on checkout
65
66 ## <a name="Automate patch - branches"></a> Automate patch -&gt; branches
67
68 ### <a name="Prep:"></a> Prep:
69
70 ### <a name="Process:"></a> Process:
71
72 - Clone base repo (git clone git\_base git\_working)
73 - Starting with 3.patch
74 - Loop:
75   - Create branch with patch/delta name (git checkout -b)
76   - Apply patch (git apply --index)
77   - Commit (-m ´Apply patch X´)
78
79 ### <a name="Issues:"></a> Issues:
80
81 ## <a name="Handle binaries"></a> Handle binaries
82
83 ### <a name="Prep:"></a> Prep:
84
85 - Find a list of binaries in cvs, search for '^expand\\w+@b|o@'
86
87 ### <a name="Process:"></a> Process:
88
89 - Loop:
90   - For patch X
91   - Parse file list from patch X
92   - If patch has binary files, git check out branch X
93   - For each binary file, CVS check out listed revision over existing file
94   - Commit (-m ´Adding binaries´)
95
96 ## <a name="Merge branches into master branc"></a> Merge branches into master branch
97
98 ### <a name="Prep:"></a> Prep:
99
100 - Parse patches to make X.msg &amp; X.author
101
102 ### <a name="Process:"></a> Process:
103
104 - Loop:
105   - Merge branch X into master (git merge --squash)
106   - Commit with message &amp; author for patch X (git commit)
107   - ! On failure... stop, and allow for reset
108 - Push master to origin/master
109
110 ## <a name="Validate and release"></a> Validate and release
111
112 - Check that checkout of master matches cvs HEAD
113
114 ## <a name="Handle tags"></a> Handle tags
115
116 - Determine tag-&gt;delta relationship
117
118 -- [[MichaelMeffie]] - 28 Oct 2008