git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Miles BaderNext: Peter Baumann
Message 4 of 7 in “are hashes calculated from data”
  1. Raymond AugeApr 2, 2010
  2. Avery PennarunApr 2, 2010
  3. Miles BaderApr 2, 2010
  4. Avery PennarunApr 2, 2010
  5. Peter BaumannApr 2, 2010
  6. Avery PennarunApr 2, 2010
  7. Peter BaumannApr 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.