| #!/bin/bash | |
| # *** Don't run this script :-) *** | |
| ROOT=/shared/eclipse/e4/git/cvs | |
| MIGR=$ROOT/org.eclipse.migration | |
| ################################################## | |
| # first up, the big one: eclipse.platform.ui | |
| # make the fake cvs repo in the right shape | |
| CVS_LOC=$ROOT/cvsroot.eclipse.platform.ui | |
| mkdir $CVS_LOC | |
| cd $CVS_LOC | |
| cvs -d :local:$(pwd) init | |
| mkdir -p eclipse.platform.ui | |
| cd eclipse.platform.ui | |
| mkdir bundles examples features tests | |
| MIGR_PASS=$MIGR/eclipse.platform.ui/pass3 | |
| cd /cvsroot/eclipse | |
| . $MIGR_PASS/modules_ui.sh | |
| for M in $MODULES; do | |
| echo $M | |
| cp -r $M $CVS_LOC/eclipse.platform.ui/bundles | |
| done | |
| cd $CVS_LOC/eclipse.platform.ui/bundles | |
| mv *tests* ../tests | |
| mv *example* *snippet* ../examples | |
| # clean the CVS repo of links | |
| find $CVS_LOC -type l|xargs -n 1 rm | |
| #get the tool, once | |
| cd $ROOT | |
| svn co --username=guest --password="" http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk | |
| # generate the import data | |
| # make sure the author names are correct | |
| # make sure your options file points to the correct tmp cvsroot | |
| cvs2svn-trunk/cvs2git --options=$MIGR_PASS/cvs2git.options >cvs2git_log.txt 2>&1 | |
| cp symbol-info.txt $MIGR_PASS | |
| # create a git repo to be used for verification | |
| git init verify.eclipse.platform.ui | |
| cd verify.eclipse.platform.ui | |
| cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import | |
| python ../cvs2svn-trunk/contrib/git-move-refs.py | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| # verify the repo - this can take long, so for your first test skip this step. | |
| cd $ROOT | |
| mkdir compare-tmp | |
| python $ROOT/cvs2svn-trunk/contrib/verify-cvs2svn.py \ | |
| --git $CVS_LOC/eclipse.platform.ui \ | |
| $ROOT/verify.eclipse.platform.ui \ | |
| --tmp=$ROOT/compare-tmp --diff >$MIGR_PASS/compare-log.txt 2>&1 & | |
| # create a git repo to continue the conversion | |
| git init target.eclipse.platform.ui | |
| cd target.eclipse.platform.ui | |
| cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import | |
| python ../cvs2svn-trunk/contrib/git-move-refs.py | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| # we also have to delete at least 2 tags: | |
| git tag 'R3_6_api_cleanup_build_20091125' 'R3_6_api_cleanup_<build_20091125>' | |
| git tag -d 'R3_6_api_cleanup_<build_20091125>' | |
| git tag 'R3_6_p2_api_cleanup_20091216' 'R3_6_p2_api_cleanup_<20091216>' | |
| git tag -d 'R3_6_p2_api_cleanup_<20091216>' | |
| # Fixing the Delete only tags: | |
| cd $ROOT | |
| /bin/bash $MIGR/scripts/fix_tags.sh >$MIGR_PASS/tag_report.sh | |
| grep ^git $MIGR_PASS/tag_report.sh >$MIGR_PASS/mv_tags.sh | |
| # examine them | |
| /bin/bash $MIGR_PASS/mv_tags.sh | |
| # now examine the repo, hopefully the tags and branches that we care about are in decent shape. | |
| # In my case, I see Cherrypick markers for a couple of tags. When the conversion is complete and most | |
| # people are happy, a developer will have to examine these commits to see if they | |
| # can be simplified. | |
| grep ^Cherry $MIGR_PASS/tag_report.sh >$MIGR_PASS/tag_cherrypicks.txt | |
| grep "R[34]_" $MIGR_PASS/tag_cherrypicks.txt | |
| #Cherrypick tag: R3_0 commit: ead7a690ae2a6b78507ee0705e2cdd193c4c9dfd | |
| #Cherrypick tag: R3_0_2 commit: 33b9f9f25fd8e45cd2206a504725bcfb03e9199f | |
| #Cherrypick tag: R3_1 commit: 83d5b3b8596bf06ceea3cf0054dd6c66e049f054 | |
| #Cherrypick tag: R3_3_1_1 commit: a74e9bad283b3d01ec5683fa719710e9ca0e645b | |
| #Cherrypick tag: R3_4_1 commit: 96e8167b3756219d62dcaf5318c6a42f1b93dfb9 | |
| #Cherrypick tag: R3_5 commit: 4186af7444f9685e7f4bf27cfe1878866ce9a2e5 | |
| #Cherrypick tag: Root_R3_4_maintenance commit: e4ec86e43c2cec1e0d6e94660bed1704d5eaf41d | |
| git branch >$MIGR_PASS/branches.txt | |
| git tag >$MIGR_PASS/tags.txt | |
| # | |
| # after the other repos are converted, the next step is the merge with eclipse.platform.ui.e4 | |
| # | |
| ################################################## | |
| # next, org.eclipse.e4.tools since it should be isolated | |
| MODULE_NAME=org.eclipse.e4.tools | |
| cd $ROOT | |
| CVS_LOC=$ROOT/cvsroot.$MODULE_NAME | |
| mkdir -p $CVS_LOC/e4 | |
| cd $CVS_LOC | |
| cvs -d :local:$(pwd) init | |
| MIGR_PASS=$MIGR/org.eclipse.e4.tools/pass3 | |
| cp -r /cvsroot/eclipse/e4/$MODULE_NAME $CVS_LOC/e4 | |
| # clean the CVS repo of links | |
| find $CVS_LOC -type l|xargs -n 1 rm | |
| # generate the import data | |
| # make sure the author names are correct | |
| # make sure your options file points to the correct tmp cvsroot | |
| cd $ROOT | |
| vi $MIGR_PASS/cvs2git.options | |
| rm -rf cvs2svn-tmp symbol-info.txt cvs2git_log.txt | |
| cvs2svn-trunk/cvs2git --options=$MIGR_PASS/cvs2git.options >cvs2git_log.txt 2>&1 | |
| cp symbol-info.txt cvs2git_log.txt $MIGR_PASS | |
| # create a git repo to be used for verification | |
| git init verify.$MODULE_NAME | |
| cd verify.$MODULE_NAME | |
| cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import | |
| python ../cvs2svn-trunk/contrib/git-move-refs.py | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| # verify the repo - this can take long, so for your first test skip this step. | |
| cd $ROOT | |
| rm -rf compare-tmp | |
| mkdir compare-tmp | |
| python $ROOT/cvs2svn-trunk/contrib/verify-cvs2svn.py \ | |
| --git $CVS_LOC/e4/$MODULE_NAME \ | |
| $ROOT/verify.$MODULE_NAME \ | |
| --tmp=$ROOT/compare-tmp --diff >$MIGR_PASS/compare-log.txt 2>&1 & | |
| # create a git repo to continue the conversion | |
| cd $ROOT | |
| git init target.$MODULE_NAME | |
| cd target.$MODULE_NAME | |
| cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import | |
| python ../cvs2svn-trunk/contrib/git-move-refs.py | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| # Fixing the Delete only tags: | |
| cd $ROOT/target.$MODULE_NAME | |
| /bin/bash $MIGR/scripts/fix_tags.sh >$MIGR_PASS/tag_report.sh | |
| grep ^git $MIGR_PASS/tag_report.sh >$MIGR_PASS/mv_tags.sh | |
| # examine them | |
| /bin/bash $MIGR_PASS/mv_tags.sh | |
| # now examine the repo, hopefully the tags and branches that we care about are in decent shape. | |
| # In my case, I see Cherrypick markers for a couple of tags. When the conversion is complete and most | |
| # people are happy, a developer will have to examine these commits to see if they | |
| # can be simplified. | |
| grep ^Cherry $MIGR_PASS/tag_report.sh >$MIGR_PASS/tag_cherrypicks.txt | |
| grep "R[34]_" $MIGR_PASS/tag_cherrypicks.txt | |
| # No R?_ Cherry pick tags | |
| git branch >$MIGR_PASS/branches.txt | |
| git tag >$MIGR_PASS/tags.txt | |
| # last step before you deploy: | |
| cd $ROOT | |
| cat - >gitignore <<EOF | |
| bin/ | |
| *~ | |
| *.rej | |
| *.bak | |
| core | |
| *.patch | |
| javacore.* | |
| heapdump.* | |
| core.* | |
| Snap.* | |
| target/ | |
| EOF | |
| cd target.$MODULE_NAME | |
| # from http://stackoverflow.com/questions/3895453/how-do-i-make-a-git-commit-in-the-past | |
| new_file=$(git hash-object -w ../gitignore) | |
| git filter-branch \ | |
| --index-filter \ | |
| 'git update-index --add --cacheinfo 100644 '"$new_file"' .gitignore' \ | |
| --tag-name-filter cat \ | |
| -- --all | |
| git reset --hard | |
| #create deploy | |
| cd $ROOT | |
| git clone --bare target.$MODULE_NAME deploy.$MODULE_NAME | |
| cd deploy.$MODULE_NAME | |
| git remote rm origin | |
| git config -l | |
| git config --add core.sharedrepository 1 | |
| #final pack and prune step | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| cd $ROOT | |
| scp -r deploy.$MODULE_NAME pwebster@git.eclipse.org:/gitroot/e4/${MODULE_NAME}.git | |
| ################################################## | |
| # next, eclipse.platform.ui.e4 - graduated Eclipse4 UI bundles | |
| MODULE_NAME=eclipse.platform.ui.e4 | |
| cd $ROOT | |
| CVS_LOC=$ROOT/cvsroot.$MODULE_NAME | |
| mkdir -p $CVS_LOC/e4 | |
| cd $CVS_LOC | |
| cvs -d :local:$(pwd) init | |
| MIGR_PASS=$MIGR/$MODULE_NAME/pass3 | |
| $MIGR/scripts/copy_e4.sh $MIGR_PASS/modules_platform_ui.sh $CVS_LOC | |
| # fix up the compat tests that moved into platform ui | |
| cd $CVS_LOC/e4 | |
| mv org.eclipse.e4.compatibility/tests/* org.eclipse.e4.ui/tests | |
| mv org.eclipse.e4.compatibility/features/org.eclipse.e4.rcp/ org.eclipse.e4.ui/features | |
| #confirm there's nothing else in there | |
| find org.eclipse.e4.compatibility/ -type f | |
| # clean the CVS repo of links | |
| find $CVS_LOC -type l|xargs -n 1 rm | |
| # generate the import data | |
| # make sure the author names are correct | |
| # make sure your options file points to the correct tmp cvsroot | |
| cd $ROOT | |
| vi $MIGR_PASS/cvs2git.options | |
| rm -rf cvs2svn-tmp symbol-info.txt cvs2git_log.txt | |
| cvs2svn-trunk/cvs2git --options=$MIGR_PASS/cvs2git.options >cvs2git_log.txt 2>&1 | |
| cp symbol-info.txt cvs2git_log.txt $MIGR_PASS | |
| # create a git repo to be used for verification | |
| git init verify.$MODULE_NAME | |
| cd verify.$MODULE_NAME | |
| cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import | |
| python ../cvs2svn-trunk/contrib/git-move-refs.py | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| # verify the repo - this can take long, so for your first test skip this step. | |
| cd $ROOT | |
| rm -rf compare-tmp | |
| mkdir compare-tmp | |
| python $ROOT/cvs2svn-trunk/contrib/verify-cvs2svn.py \ | |
| --git $CVS_LOC/e4/$MODULE_NAME \ | |
| $ROOT/verify.$MODULE_NAME \ | |
| --tmp=$ROOT/compare-tmp --diff >$MIGR_PASS/compare-log.txt 2>&1 & | |
| # create a git repo to continue the conversion | |
| git init target.$MODULE_NAME | |
| cd target.$MODULE_NAME | |
| cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import | |
| python ../cvs2svn-trunk/contrib/git-move-refs.py | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| # Fixing the Delete only tags: | |
| cd $ROOT/target.$MODULE_NAME | |
| /bin/bash $MIGR/scripts/fix_tags.sh >$MIGR_PASS/tag_report.sh | |
| grep ^git $MIGR_PASS/tag_report.sh >$MIGR_PASS/mv_tags.sh | |
| # examine them | |
| /bin/bash $MIGR_PASS/mv_tags.sh | |
| # now examine the repo, hopefully the tags and branches that we care about are in decent shape. | |
| # In my case, I see Cherrypick markers for a couple of tags. When the conversion is complete and most | |
| # people are happy, a developer will have to examine these commits to see if they | |
| # can be simplified. | |
| grep ^Cherry $MIGR_PASS/tag_report.sh >$MIGR_PASS/tag_cherrypicks.txt | |
| grep "R[34]_" $MIGR_PASS/tag_cherrypicks.txt | |
| # No changes here | |
| git branch >$MIGR_PASS/branches.txt | |
| git tag >$MIGR_PASS/tags.txt | |
| # the next step for this one is to be merged into eclipse.platform.ui | |
| ################################################## | |
| # next, eclipse.platform.runtime.e4 - graduated Eclipse4 core bundles | |
| MODULE_NAME=eclipse.platform.runtime.e4 | |
| cd $ROOT | |
| CVS_LOC=$ROOT/cvsroot.$MODULE_NAME | |
| mkdir -p $CVS_LOC/e4 | |
| cd $CVS_LOC | |
| cvs -d :local:$(pwd) init | |
| MIGR_PASS=$MIGR/$MODULE_NAME/pass3 | |
| $MIGR/scripts/copy_e4.sh $MIGR_PASS/modules_platform_runtime.sh $CVS_LOC | |
| # clean the CVS repo of links | |
| find $CVS_LOC -type l|xargs -n 1 rm | |
| # generate the import data | |
| # make sure the author names are correct | |
| # make sure your options file points to the correct tmp cvsroot | |
| cd $ROOT | |
| vi $MIGR_PASS/cvs2git.options | |
| rm -rf cvs2svn-tmp symbol-info.txt cvs2git_log.txt | |
| cvs2svn-trunk/cvs2git --options=$MIGR_PASS/cvs2git.options >cvs2git_log.txt 2>&1 | |
| cp symbol-info.txt cvs2git_log.txt $MIGR_PASS | |
| # create a git repo to be used for verification | |
| git init verify.$MODULE_NAME | |
| cd verify.$MODULE_NAME | |
| cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import | |
| python ../cvs2svn-trunk/contrib/git-move-refs.py | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| # verify the repo - this can take long, so for your first test skip this step. | |
| cd $ROOT | |
| rm -rf compare-tmp | |
| mkdir compare-tmp | |
| python $ROOT/cvs2svn-trunk/contrib/verify-cvs2svn.py \ | |
| --git $CVS_LOC/e4/$MODULE_NAME \ | |
| $ROOT/verify.$MODULE_NAME \ | |
| --tmp=$ROOT/compare-tmp --diff >$MIGR_PASS/compare-log.txt 2>&1 & | |
| # create a git repo to continue the conversion | |
| cd $ROOT | |
| git init target.$MODULE_NAME | |
| cd target.$MODULE_NAME | |
| cat ../cvs2svn-tmp/git-blob.dat ../cvs2svn-tmp/git-dump.dat | git fast-import | |
| python ../cvs2svn-trunk/contrib/git-move-refs.py | |
| git prune | |
| git repack -a -d --depth=250 --window=250 | |
| git gc --aggressive | |
| git repack -a -d --depth=250 --window=250 | |
| # Fixing the Delete only tags: | |
| cd $ROOT/target.$MODULE_NAME | |
| /bin/bash $MIGR/scripts/fix_tags.sh >$MIGR_PASS/tag_report.sh | |
| grep ^git $MIGR_PASS/tag_report.sh >$MIGR_PASS/mv_tags.sh | |
| # examine them | |
| /bin/bash $MIGR_PASS/mv_tags.sh | |
| # now examine the repo, hopefully the tags and branches that we care about are in decent shape. | |
| # In my case, I see Cherrypick markers for a couple of tags. When the conversion is complete and most | |
| # people are happy, a developer will have to examine these commits to see if they | |
| # can be simplified. | |
| grep ^Cherry $MIGR_PASS/tag_report.sh >$MIGR_PASS/tag_cherrypicks.txt | |
| grep "R[34]_" $MIGR_PASS/tag_cherrypicks.txt | |
| # No changes here | |
| git branch >$MIGR_PASS/branches.txt | |
| git tag >$MIGR_PASS/tags.txt | |
| # the next step for this one is to be merged into eclipse.platform.runtime ... still to be converted | |