[postgis-devel] git mirror setup and sync script
'Sandro Santilli'
strk at keybit.net
Thu Sep 13 00:43:32 PDT 2012
Just in case it gets lost, this is the script I'm running
hourly to keep the git mirror in sync with SVN:
{
cd POSTGIS_GIT_SVN_ROOT
git svn fetch
git branch -r | grep -v `git remote` | grep -v tags |
grep -iv 2007 | grep -v pgis | grep -v refractions |
sed 's/ *//' |
while read; do
cmd="git push origin ${REPLY}:refs/heads/svn-${REPLY}"
echo $cmd
$cmd
done
git branch -r | grep tags | sed 's/ *tags\///' |
while read; do git tag "${REPLY}" tags/$REPLY; done
git push origin --tags
}
The POSTGIS_GIT_SVN_ROOT dir need to exist, be a "git svn clone"
of the full postgis SVN (--stdlayout) pointing to an updated
authors file (--authors-file=<filename>). The authors file
we have in the repository, but you'll need to copy it somewhere
before cloning (of course).
The mechanism is weak in that a new author would likely
break the script. Re-pointing the referenced authors file
(it's referenced in .git/config after the clone) to the
version within the repository might make it a little more
stable, but only if an author is added to authors.git more than
one hour before it commits his first contribution...
Once done with jenkings we may want to move the synchronizer over
postgis.net and run on a per-commit basis rather than hourly.
NOTE that a similar setup exists for GEOS.
--strk;
More information about the postgis-devel
mailing list