(no commit message)
[openafs-wiki.git] / archive / OpenAFSCVSToGitConversion.mdwn
1 [[!toc levels=3]]
2
3 #  Git Plan:
4
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.
6
7
8 ##  Background
9
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,
11
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.
16
17 ##  Overview of the process
18
19 ##  Where the tools are
20
21 /afs/sinenomine.net/public/openafs/projects/git\_work/
22
23 ##  Set up base Repo
24
25 ###  Prep:
26
27 ###  Process:
28
29 #### (commit 1) Start from IBM 1.0 + 3.6 docs
30
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
36 - git init
37 - git add .
38 - git commit -m "Initial IBM source code import\\rDelta initial-20001103" --author="Transarc <afs@transarc.com>"
39
40 #### (commit 2) Apply license changes
41
42 - Apply 2.patch
43 - Cleanup: rm .rej & .orig
44 - untar 2-postapply.tar
45 - git commit -m "" --author="Transarc <afs@transarc.com>"
46
47 ###  Patch Fixup
48
49 - Original codebase had bit errors; tarball used for git base does not have them, remove (most of) these fixes from patchsets
50
51 ###  Repo Fixup
52
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
58 - Store commit 3 diff
59 - Stash commit 2
60 - Reset to commit 1
61 - Apply commit 3 diff
62 - Amend commit 1
63 - Reapply commit 2
64
65 ###  Issues:
66
67 license changes won´t apply cleanly as initial was from RCS and CVS munged rev vars on checkout
68
69 ##  Automate patch -> branches
70
71 ###  Prep:
72
73 ###  Process:
74
75 - Clone base repo (git clone git\_base git\_working)
76 - Starting with 3.patch
77 - Loop:
78   - Create branch with patch/delta name (git checkout -b)
79   - Apply patch (git apply --index)
80   - Commit (-m ´Apply patch X´)
81
82 ###  Issues:
83
84 ##  Handle binaries
85
86 ###  Prep:
87
88 - Find a list of binaries in cvs, search for '^expand\\w+@b|o@'
89
90 ###  Process:
91
92 - Loop:
93   - For patch X
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´)
98
99 ##  Merge branches into master branch
100
101 ###  Prep:
102
103 - Parse patches to make X.msg & X.author
104
105 ###  Process:
106
107 - Loop:
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
112
113 ##  Validate and release
114
115 - Check that checkout of master matches cvs HEAD
116
117 ##  Handle tags
118
119 - Determine tag->delta relationship
120