|
| 1 | +The git-cvs source code respository can be found here: |
| 2 | + |
| 3 | + http://github.com/wu-lee/git-cvs/ |
| 4 | + |
| 5 | + |
| 6 | +There's no installer, but the script is self-contained and just needs to be on |
| 7 | +the execution $PATH (as well as git and cvs). |
| 8 | + |
| 9 | +Given a CVS repository at $CVS_ROOT, tracking a module $CVS_MODULE can be done |
| 10 | +like this: |
| 11 | + |
| 12 | + # Create a git repo |
| 13 | + mkdir repo_name |
| 14 | + cd repo_name |
| 15 | + |
| 16 | + # (Note, there should be no .git directory here already, as this will |
| 17 | + # stop git cvsimport working correctly with the -o option) |
| 18 | + |
| 19 | + # Initialise git-cvs's config file |
| 20 | + echo cvsroot=$CVS_ROOT >.git-cvs |
| 21 | + echo cvsmodule=$CVS_MODULE >>.git-cvs |
| 22 | + |
| 23 | + # Optionally create an authormap for git-cvsimport, e.g.: |
| 24 | + # echo "$CVSUSER=$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" > $cvs_authors |
| 25 | + # |
| 26 | + # ... and supply the option --author-file $cvs_authors on the first |
| 27 | + # git-cvs pull. |
| 28 | + # |
| 29 | + # git-cvsimport will then copy $cvs_authors into .git/cvs-authors, |
| 30 | + # and use it on subsequent invocations; the original $cvs_authors |
| 31 | + # file can be deleted. |
| 32 | + # |
| 33 | + # See the documentation for git-cvsimport's -A option for more information. |
| 34 | + |
| 35 | + # Pull gets cvs files using git-cvsimport. (cvsimport will initialise .git |
| 36 | + # and copy any $cvs_authors file specified into it) |
| 37 | + git-cvs pull # or: git-cvs pull --author-file $cvs_authors |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + # hack hack... |
| 42 | + |
| 43 | + # Push the files back into CVS with git-cvsexportcommit |
| 44 | + # (This pushes the commits master..remotes/cvs/cvshead by default, |
| 45 | + # or cvsworking/NAME..remotes/cvs/NAME for each CVS branch NAME) |
| 46 | + git-cvs push |
| 47 | + |
| 48 | + # Pull the changes back into remote/cvs/cvshead and |
| 49 | + # (a messy part I've not found a way round yet) throw away our |
| 50 | + # locally merged commits |
| 51 | + git-cvs pull |
| 52 | + git reset --hard master |
| 53 | + |
| 54 | + # More hacking... |
| 55 | + |
| 56 | + # Repeat push/pull steps as needed |
| 57 | + |
| 58 | + |
| 59 | +Some other points: |
| 60 | + |
| 61 | + - Changes in CVS get pulled back, including multiple branches. |
| 62 | + |
| 63 | + - An author-mapping file can be supplied as for cvs-import -A |
| 64 | + |
| 65 | + - The script creates local CVS working directories |
| 66 | + .git/git-cvs/cvscheckout/NAME, one for each CVS branch NAME. |
| 67 | + |
| 68 | + - Git's master branch tracks CVS's HEAD branch. |
| 69 | + |
| 70 | + - A git branch cvsworking/NAME is created to track each CVS branch NAME. |
| 71 | + |
| 72 | + - Edits in these branches get pushed back to the appropriate CVS branches. |
| 73 | + |
| 74 | + - Verbose subcommand output currently goes into .git/git-cvs/logs. |
| 75 | + |
| 76 | + - Invoking git-cvs with no parameters gets information about the options. |
| 77 | + |
| 78 | + - In an emergency, a list of commit ids can be supplied to git-cvs push. |
| 79 | + |
| 80 | + - Written in Perl, uses only core modules (tested with v5.8.8) |
| 81 | + |
| 82 | + - There is a small test suite in t/, run individually or with "prove/*.t" |
| 83 | + |
0 commit comments