[postgis-devel] git mirror

Sandro Santilli strk at keybit.net
Tue May 22 05:36:50 PDT 2012


I've been re-cloning the PostGIS SVN repository into a GIT one
while making sure to retain full authors information. You may
have noticed the result of that being the authors.git file.

Interesting enough, the GIT commit identifiers differ from the
ones I had w/out specifying an author file. This means that
differently "cloned" repositories won't have common roots.

So, in order to match, the svn cloning procedure is as follows:

  SVNROOT=http://svn.osgeo.org/postgis
  wget ${SVNROOT}/trunk/authors.git
  git svn clone --authors-file=authors.git --stdlayout ${SVNROOT}/

For a quick verification, output of 

  git show --summary be40e05 | grep git-svn-id | awk '{print $2}'

should give you:

  http://svn.osgeo.org/postgis/trunk@9773

After that, you might want to setup all branches:

  git branch -r  | grep -v `git remote`  | grep -v tags | sed 's/ *//' |
  while read; do git branch "svn-${REPLY}" $REPLY; done

And all tags:

  git branch -r  | grep  tags | sed 's/ *tags\///' |
  while read; do git tag "${REPLY}" tags/$REPLY; done

The branches and tags operation may need to be performed again whenever
things change on the SVN side, changes which you would get with:

  git svn fetch

I pushed the result of the above processing to a github repository:

  https://github.com/postgis/postgis

And will setup an hourly cronjob to keep it updated.

Cloning again from SVN will take time (possibly hours).
Cloning from the github mirror is way faster, but setting a link
back to SVN for direct commits is trickier:

  git clone git://github.com/postgis/postgis.git
  cd postgis
  git svn init --stdlayout http://svn.osgeo.org/postgis
  cp authors.git ..
  git config svn.authorsfile ../authors.git

  # Link branches to SVN
  git show-ref | grep remotes | grep svn | sed 's/.*svn-//' |
    while read; do
      git update-ref refs/remotes/${REPLY} refs/remotes/origin/svn-${REPLY};
    done

  # Link tags to SVN
  git tag -l | 
    while read; do
      git update-ref refs/remotes/tags/${REPLY} ${REPLY};
    done

  # Rebuild revision maps
  git svn fetch 

I'm working on the procedure to keep the mirror in sync.
Meanwhile maybe we want to drop some of the automatically created branches:

  svn-0.9
  svn-1.0
  svn-1.1
  svn-1.3
  svn-1.4
  svn-1.5
  svn-2.0
  svn-gSoC2007
  svn-gSoC2007_raster
  svn-pgis_0_9_0
  svn-pgis_1_0
  svn-refractions
  svn-trunk

In particular, it looks like the gSoC branches are spikes
in SVN, rather than proper branches, and the _current_ SVN
seems to only know about the numbered branches:

  http://svn.osgeo.org/postgis/branches/

I guess I can drop the unknown ones ?

--strk; 

  ,------o-. 
  |   __/  |    Delivering high quality PostGIS 2.0 !
  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'




More information about the postgis-devel mailing list