Re: are hashes calculated from data
- From
Avery Pennarun <apenwarr@gmail.com>
- Date
- Apr 2, 2010, 04:48 UTC
- Message-ID
- <y2j32541b131004012148w283911f8pf04a21fc307f68ed@mail.gmail.com>
- In-Reply-To
- <buozl1mbi0o.fsf@dhlpc061.dev.necel.com>
On Fri, Apr 2, 2010 at 12:22 AM, Miles Bader <miles@gnu.org> wrote:
Show 11 quoted lines
> Avery Pennarun <apenwarr@gmail.com> writes: >> At work, we have a cronjob that basically does most of these steps for >> us. Then there's a central git repo that corresponds to the svn repo; >> people who want to use git can use that repo and not worry about >> git-svn. > > Do you happen to have the cron script available for perusal anywhere? > > I imagine many of the details would need to be changed for other > installations, but just looking at a working concrete example could be > very helpful...
Unfortunately the particular script we're using is about 99% local stuff and 1% useful stuff, so posting it won't really help. The pseudocode is something like this:
# configure your git-svn so that all its branches are under remotes/svn/*
git fetch origin
git svn fetch --fetch-all
for each branch in remotes/svn/*
git checkout remotes/svn/$branch # detaches HEAD
git merge --no-ff origin/$branch
git svn dcommit # replaces merge commit
git checkout origin/$branch
git merge remotes/svn/$branch
git push origin HEAD:$branch
git push origin refs/remotes/svn/*:refs/heads/svn/*And then people who want to push into svn can push into the 'origin' repository, wherever that may be. With some tweaking, you could make the git-svn repo and the origin repo the same. It's a little annoying because git-svn absolutely insists on its branches being in refs/remotes/ somewhere, which means they don't normally get fetched when other people grab from your repo.
Also consider setting [merge]summary=true in your .gitconfig, so that the svn commit will have *some* useful information about what got committed.
Hope this helps.
Avery