wiki:ChimeraWithGit

Developing Chimera with git

It's possible to work with git on a subversion repository. For example, see http://www.viget.com/extend/effectively-using-git-with-subversion.

Importing an existing git repository

I started out developing an extension for Chimera with a git repository. It was possible to import the git repository history into the Chimera subversion repository, using some instructions from google code. I ran the following:

#
# Step 1.  Create a git svn clone of the Chimera source.
#
cd /data/src/
mkdir tmp
cd tmp/
git svn clone svn+ssh://plato.cgl.ucsf.edu/usr/local/src/svn/chimera/trunk chimera
# Wait a long time for this to catch up on 30000+ commits
cd chimera
git status
#
# Step 2. Fetch the git repository for my Chimera extension.
#
git fetch ssh://weber.cgl.ucsf.edu/data/gitroot/chimera-extension
# Create a temporary branch for the fetched repository, and tag its head:
git branch tmp $(cut -b-40 .git/FETCH_HEAD)
git tag -a -m "Animation last fetch" last tmp
#
# Step 3.  Apply the initial commit from my git repository onto the git-svn
#
INIT_COMMIT=$(git log tmp --pretty=format:%H | tail -1)
git checkout $INIT_COMMIT .
git commit -C $INIT_COMMIT
#
# Step 4.  Rebase and submit
#
# Apply all the other commits to the tmp branch; make it the new master branch.
git rebase master tmp
git branch -M tmp master
#
# Step 5.  Shuffle some files around.
#
mkdir libs/Animate
git mv anim/* libs/Animate/
rmdir anim
git status
git rm .project
git rm .pydevproject
git rm -r .settings
git status
mkdir libs/Animate/TkExamples
git mv TkExamples/* libs/Animate/TkExamples/
rmdir TkExamples
git rm -r TemplateExtension
git rm -r PyUML
git rm -r midasExamples
git commit -m "Reshuffle animation project files to fit into Chimera subversion repository"
#
# Step 6.  Lastly, commit the changes back to the svn repository.
#
git svn dcommit --rmdir --find-copies-harder
Last modified 15 years ago Last modified on Apr 18, 2011, 11:19:55 AM
Note: See TracWiki for help on using the wiki.