Using git-svn with pgAdmin's Subversion repository
It is possible to use git-svn instead of subversion when working on the pgAdmin source tree. This gives you the advantage of having the full history in the git repo, and the ability to easily create local branches when working offline.
Note: Only trunk and the REL-1_10_0_PATCHES branch will currently build correctly in a git tree, as other branches only support being built in a subversion tree or from a tarball. This is due to the way we pull in the subversion revision number during the build. Rudimentary support for doing this from git-svn has been added to trunk, and REL-1_10_0_PATCHES has been updated to set the revision number to 'unknown' if it cannot be obtained from subversion.
Getting started
To get going, you need to clone the repo. I'll assume you already have git installed.
$ git svn clone svn+ssh://username@svn.pgadmin.org/repos/trunk/pgadmin3 PGADMIN-TRUNK
or if you do not have an account on svn.pgadmin.org:
$ git svn clone svn://svn.pgadmin.org/trunk/pgadmin3 PGADMIN-TRUNK
This will create a repo in ./PGADMIN-TRUNK. It'll start out at subversion revision 0 (at least it did on my machine), so you need to rebase it to get it to the latest revision:
$ cd PGADMIN-TRUNK $ git svn rebase
This will take quite some time, as it grabs every revision (currently over 8000). Once it's done, you should have a master branch which matches the head of the pgAdmin development tree. You can now work in this repo as you would with git, creating branches and committing changes etc.
Day to day use
To update the current git branch to the head of the subversion repo, use a command line:
$ git svn rebase
When you've completed some work, you can either use git diff to create a patch, or if you are a committer, you can do something like:
$ git svn dcommit
which will commit your changes from the current git branch to the master subversion repository. Note that this will make each and every one of your git commits into one svn commit each. For this reason, you probably want to do this before you do dcommit:
$ git rebase git-svn --interactive
and squash several of your commits into one.
More stuff
For more information, see the git-svn manual page.
