Skip to content

Sync github with Bioconductor's svn

Johannes Rainer edited this page Jun 16, 2017 · 5 revisions

Sync github with Bioconductor's svn

Development for xcms is performed in the devel and the xcms3 branch on github with the latter containing the bleeding edge changes and the former representing a more stable version (but still developmental). The biocdevel is used to keep Bioconductor's svn repository in sync with the github version.

Setting up the branches to sync with BioC

First clone the package.

git clone https://github.com/sneumann/xcms
cd xcms

Then we add the Bioconductor github mirror as a remote and fetch its content.

git remote add bioc "https://github.com/Bioconductor-mirror/xcms.git"
## Get the stuff from that mirror
git fetch bioc

Next we add the svn remotes.

git config --add svn-remote.biocdevel.url "https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/xcms"
git config --add svn-remote.biocdevel.fetch :refs/remotes/git-svn-biocdevel
git update-ref refs/remotes/git-svn-biocdevel refs/remotes/bioc/master

And finally create the biocdevel branch and set it up to track the github mirror.

git branch --track biocdevel bioc/master

Now we check out the biocdevel branch and rebase it.

git checkout biocdevel
git svn rebase
git pull bioc

We're set up. Eventually we might want to merge biocdevel into devel to add any changes from svn.

Commit changes from github to svn

The workflow to commit changes from github to Bioconductor's svn is detailed below.

git checkout devel
## Ensure that we're up-to-date locally
git pull

## Switch to the biocdevel branch
git checkout biocdevel
## Getting the latest from svn
git svn rebase
## Doing also a git pull - to be on the save side.
git pull bioc

Here we might eventually merge changes from biocdevel into devel but usually that's not necessary since changes in the svn are only happening very rarely.

git checkout devel
git merge biocdevel

Next we are merging devel into biocdevel. Note that we use a squashed merge. We loose therefore the git history of the individual commits, but avoid also nasty merge conflicts and causing the Bioconductor-github-mirror to get out of sync with the Bioconductor svn (too many commits in a short period can cause such sync problems).

git checkout biocdevel
git merge --squash devel
git commit

And finally we commit the changes to the svn.

git svn dcommit --add-author-from

At last we want to merge biocdevel again into devel to be on the save side and ensure that we're completely in sync. Before doing that we wait a little for the mirroring of the Bioconductor svn to the Bioconductor github mirror to complete. Don't forget to push devel branch to github after that.

## Being still on the biocdevel branch...
git pull bioc

git checkout devel
git merge biocdevel

## and push back to github
git push origin devel

New Bioconductor release

Fetch the version bump from Bioconductor into the devel branch:

## Switch to the biocdevel branch
git checkout biocdevel
## Getting the latest from svn
git svn rebase
## Doing also a git pull - to be on the save side.
git pull bioc

## Now checkout the devel branch and merge all changes.
git checkout devel
git merge biocdevel

## Finally push devel back to github
git push devel

Other notes

To ensure that xcms3 and devel are completely in sync, it seems to be better to merge first devel into xcms3 before merging xcms3 into devel.