Migrate geWorkbench codebase to github
From Informatics
The first page to look at How to Migrate from Subversion
Question: Are we supposed to be part of NCIP channel? Answer: Yes, that what we intend to do.
Contents[hide] |
Notes and logs of the migration task
Note our svn repository is a typical non-standard layout. Especially, geWorbench-web (sub-directory trunk/geworkbench-web) should be a separate project; trunk/geworkbench should be the top level directory, with most of of branches and tags (but not all of them) being about this project. After migration to git, they should all be separate projects as well as "geworkbench release", CUPID servlet, etc. Git cannot handle the multiple-project repository as I understand.
The command I used to successfully collect all the author ID's from svn using downloaded svn client from http://www.open.collab.net/, from the cygwin console on my PC:
svn log -q "https://ncisvn.nci.nih.gov/svn/geworkbench" |grep '^r' |cut -f 2 -d '|' |sed 's/^ *//;s/ *$//' |sort|uniq
geworkbench-web project
The commands to initially move the code from svn to git are mainly according to https://github.com/NCIP/ncip.github.com/wiki/How-to-Migrate-from-Subversion
- the very first step: create a directory for the new git repository, and
git --bare init
There is a discussion about --bare option at https://www.atlassian.com/git/tutorial/git-basics#!init . It might not be the right choice to use this option here.
- config the new git repository to match the geworkbench-web project
git config svn-remote.svn.url https://ncisvn.nci.nih.gov/svn/geworkbench/trunk/geworkbench-web
When this command is execute, nothing happens on the console.
- copy authors.txt to the directory of git repository we've been working in so far, and run
git config svn.authorsfile "authors.txt"
No response from the console.
At this point, there is a sub-directory branches, and a sub-directory refs. Under refs, there are heads and tags. There is not file under braches, or heads, or tags.
geWorkbench project in svb does not follow the standard layout and we don't have branches and tags properly for geWorkbench-web directory. SO I only care the latest version of geworkbench-web, which is fetched by:
git config --add svn-remote.svn.fetch :refs/heads/trunk
then
git svn fetch
Now, directories src and WebContent exist under the git repository directory.
Type gitk
on the command line, we see the revision history of this project. At this point, you can also open github GUI client, which also shows all the revision history with proper author information etc. From github GUI, I did "push to github" and then "publish".
geworkbench project (desktop application)
git init git config svn-remote.svn.url https://ncisvn.nci.nih.gov/svn/geworkbench/trunk/geworkbench/ git config svn.authorsfile "authors.txt" git config --add svn-remote.svn.fetch :refs/heads/trunk git svn fetch
git push --set-upstream origin master
The publishing didn't work. I found some seemingly relevant information http://stackoverflow.com/questions/15240815/git-fatal-the-remote-end-hung-up-unexpectedly, but it didn't solve the problem. I guess it is because this repository is too large - over the recommended limit of 1GB.
geworkbench release project
Create a new git repository for the release project.
cupid project
Create as a new git repository for CUPID servlet.
index service
Migrated from svn to github. This index service currently only covers demand and viper. This is a spring-ws based web service.
demand service
Migrated from svn to github.
viper service
Migrated from svn to github. The steps are similar to those for index service and demand service. I wrote a script called migrate.sh, which runs under viper.service.git directory to do the entire process (in Git Shell set up with GitHub) (I also tried under cygwin but it didn't get through.)
git init git config svn-remote.svn.url https://ncisvn.nci.nih.gov/svn/geworkbench/trunk/web-services/viper-server/ git config svn.authorsfile "../authors.txt" git config --add svn-remote.svn.fetch :refs/heads/trunk git svn fetch git remote set-url origin https://github.com/geworkbench-group/viper.service.git git push --set-upstream origin master
More from Juli Klemm's email May 6, 2013
NCIP GitHub channel – This is where we are migrating much of the caBIG code
SVN>>GitHub migration resources we’re using to support our migration
https://github.com/NCIP/ncip.github.com/wiki/_pages
Here is an example CONTRIBUTIONG file (from caGWAS) explaining to the community how to contribute to the given GitHub repository
https://github.com/NCIP/cagwas/blob/master/CONTRIBUTING.rst I don't think this completely applies to other projects. For example, we don't use the tracker system used by caGWAS.