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

Re: How to clone git repository with git-svn meta-data included?

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Dec 9, 2008, 08:53 UTC
Message-ID
<493E3209.9060105@drmicha.warpmail.net>
In-Reply-To
<493D66BB.3060907@tuffmail.com>
Grzegorz Kossakowski venit, vidit, dixit 08.12.2008 19:26:
Show 25 quoted lines
> Michael J Gruber pisze:
>> Could it be as simple as a missing "cd cocoon" between git clone and git
>> svn rebase? No, you probably did that.
> 
> That would be too easy.
> 
>> But note that you did not follow Peter's instructions. The point is that
>> your clone creates "remotes/origin/trunk" whereas Peter's instructions
>> mirror the source, creating "remotes/trunk", which is what git svn needs
>> (unless you say "git svn init -s --prefix=origin/" or "git config
>> svn-remote.svn.fetch trunk:refs/trunk" etc.). The prefix solution should
>> be the best.
>>
>> Michael
>>
>> P.S.: Peter starts off a different layout (standard svn remotes, which
>> need special instructions to be cloned). Ordinary clone + git svn init
>> --prefix=origin/ should work fine for the cocoon layout.
> 
> This almost worked. Actually, Cocoon repository hosted on Jukka's server does not have local head
> named "trunk" so there is no remotes/origin/trunk created during cloning process.
> 
> I had to run:
> 
>   git update-ref refs/remotes/origin/trunk refs/heads/master

Uhm, I misread gitweb output... So, cocoon really has remotes/trunk, so that Peter's original suggestion would work. If the cocoon git-svn clone isn't going to change then Peter's way of doing it might be the best: it ensures that future pulls from origin (cocoon) will update the correct refs so that you can pull/fetch from the git-svn clone (fast) and then git-svn rebase rather than git-svn rebasing directly, which would fetch new commits from the svn repo first (slow).

I think all in all it shows that git-svns default location for branches is not the best choice: they're not local, but they're no "proper" remotes either (unless you use --prefix).

Michael
Previous: Grzegorz KossakowskiNext: Shawn O. Pearce
Message 15 of 17 in “How to clone git repository with git-svn meta-data included?”
  1. Grzegorz KossakowskiDec 6, 2008
  2. Jacob HelwigDec 7, 2008
  3. Nick AndrewDec 8, 2008
  4. Peter HarrisDec 7, 2008
  5. Grzegorz KossakowskiDec 7, 2008
  6. Peter HarrisDec 7, 2008
  7. Grzegorz KossakowskiDec 7, 2008
  8. Peter HarrisDec 7, 2008
  9. Michael J GruberDec 8, 2008
  10. Grzegorz KossakowskiDec 8, 2008
  11. Peter HarrisDec 8, 2008
  12. Grzegorz KossakowskiDec 8, 2008
  13. Sam VilainDec 9, 2008
  14. Grzegorz KossakowskiDec 9, 2008
  15. Michael J GruberDec 9, 2008
  16. Shawn O. PearceDec 8, 2008
  17. Grzegorz KossakowskiDec 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.