On 03-12-12 15:22, John Ralls wrote:
AFAICT git-svn doesn't work on a bare repo. You'll have to clone the Github repos and run
git-svn-mirror on those clones after adjusting the config file to look like the one in
the wiki page [1]. Set the "origin" remote to point to the gitolite bare repo.
Gitolite provides a mirroring facility [2] that will automatically send
changesets on to Github.
Regards,
John Ralls
[1] http://wiki.gnucash.org/wiki/Git#Setting_up_and_Maintaining_the_Mirror
[2] http://sitaramc.github.com/gitolite/mirroring.html
I've been looking into gitolite, the git-svn-mirror setup and stuff, and
I think I am ready to setup the git repos on code.gnucash.org.
Here's what I propose:
- clone the github repos as bare repos under gitolite control.
Initially, there should only one user with write access, namely the user
that will push commits from the svn-mirror repos (see below).
- Gitolite note: we probably also want to set gitolite's LOCAL_CODE rc
parameter to a directory inside the gitolite-admin repo as described
under "alternate location" here [1] so the admins can all manage git
hooks in that repo. The hooks themselves follow below.
- setup local git repos on code.gnucash.org that will only be used to
sync from svn to git (let's call these svn-mirror repos). Note that
git-svn-mirror accesses the svn repo read-only. With that in mind I
think it would make sense to setup the svn mirror repos under the same
user account as used for the svn repository itself or at least a user
that has direct read access to the repo files on the server. That allows
us to use a local file:/// url to read from the svn repo instead of
going via the network svn+ssh:// route. As John briefly describes above,
this involves following the steps in our wiki to set up and maintaining
the git-svn mirror [2]. With the exceptions that
(a) the svn repo can be accessed directly via a file:/// path and
(b) the origin repo should be changed to the gitolite one. We may
need to be careful here that user that pushes to the gitolite repos has
proper (gitolite) write permissions to do so.
- It's not clear to me if any fetch on the svn-mirror repos will
automatically trigger a push to the gitolite repos in this config or
whether we still explicitly have to set up a post commit hook for this.
That can be tested along the way.
- In any case, at this point, the svn repo's post commit hook should be
altered to run the git-svn-mirror script to automatically update the
relevant svn-mirror repos with each commit to svn. Since we're still
testing, this can be done alongside the hook that triggers jeeves to
update its mirror repos.
- If this works well (meaning that each commit to svn also properly ends
up in the gitolite repos), we can go for the next step: make gitolite
push to github and drop jeeves from the procedure. I looked at the
gitolite mirror information [3], but I couldn't figure out how that
would allow us to push changes to github. It seems to me this only works
between gitolite managed repos. git comes with some kind of mirroring
features as well which may be useful, but I haven't investigated this
yet. Perhaps John knows how these work ? I found you can clone a repo
with a --mirror option, but I don't know if that is what we are looking for.
- If that is working ok, we can continue setting up proper hooks in the
gitolite repos, for example to send e-mails on each commit. The gitolite
documentation regularly shows hooks.mailinglist [4] and similar git
options, but don't detail how these are actually used. Searching the
web, there are several examples (like this one [5]) though that explain
how to send e-mails after commits.
Once we get here, we can evaluate again what still needs to be done for
the git migration.
Geert
[1] http://sitaramc.github.com/gitolite/cust.html#pushcode
[2] http://wiki.gnucash.org/wiki/Git#Setting_up_and_Maintaining_the_Mirror
[3] http://sitaramc.github.com/gitolite/mirroring.html
[4] http://sitaramc.github.com/gitolite/git-config.html
[5]
http://www.fclose.com/b/linux/1473/setting-up-git-commit-email-notification/
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel