... | ... | @@ -2,7 +2,6 @@ |
|
|
|
|
|
|
|
|
Suppose `ghc/darcs` is a darcs GHC tree containing patches that need to be migrated to git, and `ghc/git` is a git GHC tree.
|
|
|
We're not going to try to preserve the history; just get the code into the repo.
|
|
|
|
|
|
|
|
|
This assumes that all your changes are in the ghc repo itself. Otherwise, if you have made changes to other repos (e.g. `libraries/base`) you'll need to do a similar procedure for those repos too.
|
... | ... | @@ -18,7 +17,7 @@ We'll assume the following directory setup, where `$root` is some directory in y |
|
|
|
|
|
```wiki
|
|
|
cd $root
|
|
|
darcs checkout http:://darcs.haskell.org/ghc
|
|
|
darcs get http:://darcs.haskell.org/ghc
|
|
|
mv ghc migrate
|
|
|
```
|
|
|
|
... | ... | @@ -29,19 +28,19 @@ This gets a Darcs copy of the repo, precisely at the switchover point. (We don' |
|
|
|
|
|
```wiki
|
|
|
cd $root
|
|
|
git clone ghc/git baseline-git
|
|
|
git clone http://darcs.haskell.org/ghc.git/ baseline-git
|
|
|
cd baseline-git
|
|
|
git checkout -b "some-descriptive-name" ghc-darcs-git-switchover
|
|
|
```
|
|
|
|
|
|
**SLPJ: the clone command should mention the actual URL, not assuming you have a current copy**.
|
|
|
|
|
|
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.
|
|
|
|
|
|
**Step 3**: make `migrate/` into a Git repo too! All we need do is to copy over Git's meta-data.
|
|
|
|
|
|
```wiki
|
|
|
cd $root/migrate
|
|
|
mv ../baeline-git/.git .
|
|
|
mv ../baseline-git/.git .
|
|
|
```
|
|
|
|
|
|
**Step 4**: transfer patches. For each patch (or group thereof) you want to transfer, do this:
|
... | ... | @@ -57,64 +56,13 @@ mv ../baeline-git/.git . |
|
|
|
|
|
```wiki
|
|
|
git commit -a
|
|
|
git checkout master
|
|
|
git merge "some-descriptive-name"
|
|
|
```
|
|
|
|
|
|
**SLPJ: is this commit/checkout/merge thing right? Do you need to switch back to a branch for the next pull? Do you get to write a commit message?**
|
|
|
|
|
|
**Step 4**: validate and push to Git.
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
old version
|
|
|
|
|
|
|
|
|
First, make a backup of the darcs repo in case something goes wrong:
|
|
|
**Step 5**: merge the patches into the git master:
|
|
|
|
|
|
```wiki
|
|
|
cp -a ghc/darcs ghc/backup-darcs
|
|
|
```
|
|
|
|
|
|
|
|
|
Now make sure `ghc/darcs` is fully up-to-date:
|
|
|
|
|
|
```wiki
|
|
|
cd ghc/darcs
|
|
|
./darcs-all pull -a
|
|
|
cd ../..
|
|
|
```
|
|
|
|
|
|
|
|
|
Next we checkout the git repo as it was at the darcs branch point:
|
|
|
|
|
|
```wiki
|
|
|
git clone ghc/git ghc/migrate
|
|
|
cd ghc/migrate
|
|
|
git checkout -b "some-descriptive-name" ghc-darcs-git-switchover
|
|
|
cd ../..
|
|
|
```
|
|
|
|
|
|
|
|
|
Now we put the git meta-data into our darcs repo, record the changes with git and merge them back to master:
|
|
|
|
|
|
```wiki
|
|
|
cd ghc/darcs
|
|
|
mv ../migrate/.git .
|
|
|
git commit -a
|
|
|
git checkout master
|
|
|
git merge "some-descriptive-name"
|
|
|
cd ../..
|
|
|
```
|
|
|
|
|
|
|
|
|
Finally, we pull the changes into our real git repo:
|
|
|
|
|
|
```wiki
|
|
|
cd ghc/git
|
|
|
git pull ../../ghc/darcs master
|
|
|
```
|
|
|
|
|
|
|
|
|
The `ghc/migrate` directory is no longer needed and can be removed. |
|
|
**Step 6**: validate and push to Git. |