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

Re: [PATCH] Teach git-svn how to catch up with its tracking branches

From
CSChris Shoemaker <c.shoemaker@cox.net>
Date
May 8, 2008, 07:48 UTC
Message-ID
<20080508074824.GA2197@pe.Belkin>
In-Reply-To
<alpine.DEB.1.00.0805072332300.6948@swallowtail>
On Wed, May 07, 2008 at 11:48:17PM -0700, Asheesh Laroia wrote:
Show 35 quoted lines
> On Wed, 7 May 2008, Steven Grimm wrote:
>
>> In environments where a lot of people are sharing an svn repository using
>> git-svn, everyone has identical, but individually maintained, tracking
>> branches.
>
> To further muddy the waters, let me talk about my setup, also one with a 
> "central git repository" from which all developers clone, and also one 
> based on a Subversion tree.
>
> The way I handle it is that, hidden somewhere, I have an account with a 
> cron job that does this:
>
> $ git svn fetch
> $ git push origin refs/remotes/*:refs/heads/*
> $ git push origin refs/remotes/trunk:refs/heads/master
>
> The first push synchronizes "origin" to have the same branches as this 
> git-svn copy of the git repository, and the second updates "origin" so that 
> it has a "master"; without that second step, "git clone" will error out 
> when it get to its checkout phase.
>
> Note that in .git/config, the [remote "origin"] section has no "fetch" 
> parameter.  If it did have one, a would end up creating the branch 
> origin/master on the second push, and origin/origin/master on the third, 
> and so on.
>
> After the push, "origin" ends up being a git repository that looks just 
> like the svn repository we're cloning.  When you "git clone" it, the remote 
> has all the tags and branches of the upstream svn repository; and as the 
> upstream svn repository updates its branches, the git branches get those 
> updates.
>
> I'm not saying this patch shouldn't be accepted; I have no comment on it. I 
> just want to see what others think of my approach to this workflow.

This workflow doesn't seem to provide a way for the developers who clone the "origin" above, to dcommit to svn. Presumably, with the right initialization, Steve's patch would allow all those clones to dcommit to svn directly.

I like your automated mirror setup, but IMO, it becomes a lot more useful in conjunction with Steve's patch.

-chris
Previous: Steven GrimmNext: Chris Shoemaker
Message 15 of 16 in “Teach git-svn how to catch up with its tracking branches”
  1. Teach git-svn how to catch up with its tracking branchesSteven Grimm, May 8, 2008
  2. Junio C HamanoMay 8, 2008
  3. Steven GrimmMay 8, 2008
  4. Chris ShoemakerMay 8, 2008
  5. Steven GrimmMay 8, 2008
  6. Chris ShoemakerMay 8, 2008
  7. Karl HasselströmMay 8, 2008
  8. Karl HasselströmMay 8, 2008
  9. Steven GrimmMay 8, 2008
  10. Karl HasselströmMay 8, 2008
  11. Teach git-svn how to catch up with its tracking branchesSteven Grimm, May 8, 2008
  12. Eric WongMay 11, 2008
  13. Asheesh LaroiaMay 8, 2008
  14. Steven GrimmMay 8, 2008
  15. Chris ShoemakerMay 8, 2008
  16. Chris ShoemakerMay 8, 2008

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.