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

Re: reviving a git-svn clone

From
Sam Vilain <sam@vilain.net>
Date
Apr 21, 2009, 06:51 UTC
Message-ID
<1240296712.3424.8.camel@maia.lan>
In-Reply-To
<20090420104316.GA11433@lapse.rw.madduck.net>
On Mon, 2009-04-20 at 12:43 +0200, martin f krafft wrote:
Show 5 quoted lines
> I am now trying to revive the clone, but git-svn remains "unable to
> determine the upstream SVN information from the working tree
> history". This baffles me.
> 
> Here are my steps:
Show 15 quoted lines
> -8<--8<--8<-
> alioth:~|master|% git clone /git/collab-maint/hibernate.git hibernate-svnsync
> Initialized empty Git repository in /srv/alioth.debian.org/chroot/home/users/madduck/hibernate-svnsync/.git/
> 
> alioth:~|master|% cd hibernate-svnsync
> 
> alioth:~/hibernate-svnsync|master|% git branch --no-track upstream origin/upstream
> 
> alioth:~/hibernate-svnsync|master|% cat >> .git/config <<_eof
> heredoc> [svn-remote "svn"]
> heredoc>        url = svn+ssh://svn.suspend2.net/svn/hibernate-script
> heredoc>        fetch = trunk:refs/remotes/upstream/trunk
> heredoc>        branches = branches/*:refs/remotes/upstream/*
> heredoc>        tags = tags/*:refs/remotes/upstream/tags/*
> heredoc> _eof

for git-svn to resume, it needs the refs all in the right place. If you clone a git-svn repository they will be in the wrong place.

eg for this use case something like this to copy the refs/remotes/origin/* refs to refs/remotes/upstream/*:

  git for-each-ref --format="%(refname)" refs/remotes/origin/* |
     perl -le '$x = $_; $x =~ s{origin}{upstream};
       system "git update-ref $x $_"'
It's a bit hard to test without access to the upstream svn!

Good luck, Sam.

Previous: martin f krafftNext: martin f krafft
Message 2 of 6 in “reviving a git-svn clone”
  1. martin f krafftApr 20, 2009
  2. Sam VilainApr 21, 2009
  3. martin f krafftApr 21, 2009
  4. Deskin MillerApr 21, 2009
  5. martin f krafftApr 21, 2009
  6. switching a git-svn clone to a different URL (was: reviving a git-svn clone)martin f krafft, Apr 21, 2009

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.