| | 8 | |
| | 9 | We'll assume the following directory setup, where `$root` is some directory in your file system |
| | 10 | * `$root/my-darcs`: the Darcs repo that contains the patches you'd like to move over into Git. We will make no changes to this repo. |
| | 11 | * `$root/baseline-git` (initially non-existent): the Git repo at the moment of switchover |
| | 12 | * `$root/migrate` (initially non-existent): during the transfer process this is going to be ''both'' a Darcs repo ''and'' a Git repo |
| | 13 | |
| | 14 | '''Step 1''': create `migrate`: |
| | 15 | {{{ |
| | 16 | cd $root |
| | 17 | darcs checkout http:://darcs.haskell.org/ghc |
| | 18 | mv ghc migrate |
| | 19 | }}} |
| | 20 | This gets a Darcs copy of the repo, precisely at the switchover point. (We don't need a tag, because the Darcs repos were frozen precisely at switchover, so the HEAD will do.) |
| | 21 | |
| | 22 | '''Step 2''': create `baseline-git`: |
| | 23 | {{{ |
| | 24 | cd $root |
| | 25 | git clone ghc/git baseline-git |
| | 26 | cd baseline-git |
| | 27 | git checkout -b "some-descriptive-name" ghc-darcs-git-switchover |
| | 28 | }}} |
| | 29 | This gets a Git copy of the repo, precisely at the point of switchover (that's what the `ghc-darcs-git-switchover` tag does). At this moment all the source files in `migrate` and `baseline-git` should be bit-for-bit identical. Check this. |
| | 30 | |
| | 31 | '''Step 3''': make `migrate/` into a Git repo too! All we need do is to copy over Git's meta-data. |
| | 32 | {{{ |
| | 33 | cd $root/migrate |
| | 34 | mv ../baeline-git/.git . |
| | 35 | }}} |
| | 36 | |
| | 37 | '''Step 3''': transfer patches. For each patch (or group thereof) you want to transfer, do this: |
| | 38 | * Pull the patch into `tmp-git`: |
| | 39 | {{{ |
| | 40 | cd $root/migrate |
| | 41 | darcs pull ../my-darcs |
| | 42 | ...interactively pull the patches you want... |
| | 43 | }}} |
| | 44 | * Record a Git patch for this patch group |
| | 45 | {{{ |
| | 46 | git commit -a |
| | 47 | git checkout master |
| | 48 | git merge "some-descriptive-name" |
| | 49 | }}} |
| | 50 | |
| | 51 | '''Step 4''': validate and push to Git. |
| | 52 | |
| | 53 | ---------------------- |
| | 54 | old version |