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

Re: Odd number of elements in anonymous hash

From
Sam Vilain <sam@vilain.net>
Date
Jan 24, 2008, 23:10 UTC
Message-ID
<47991ACA.7010507@vilain.net>
In-Reply-To
<200801241513.45088.devurandom@gmx.net>
Dennis Schridde wrote:
>>> Server: git config:
>>> ------
 [...]
Show 7 quoted lines
>>> [svn-remote "svn"]
>>>         useSvnsyncProps = 1
>>>         url = file:///var/svn/warzone2100
>>>         fetch = trunk:refs/remotes/trunk
>>>         branches = branches/*:refs/remotes/*
>>>         tags = tags/*:refs/remotes/tags/*
>>> ------
 [...]
>>> Local config:
>>> ------
 [...]
Show 18 quoted lines
>>> [remote "origin"]
>>>         url = git://git.kynes.de/org.gna.warzone2100.git
>>>         fetch = +refs/heads/*:refs/remotes/origin/*
>> You need to make that:
>>
>>   fetch = refs/remotes/*:refs/remotes/*
>>
>> And re-run 'git fetch' to use git-svn fetch on the cloned repository.
>> git-svn is expecting the refs/ space to be populated in the same way
>> that it is on the repository doing the initial fetch.
> Thanks a lot!
> That worked!
> 
> Possibly you should update the manpage, so no others run into this.
> It currently just says:
>        # Tell git-svn which branch contains the Subversion commits
>                git update-ref refs/remotes/git-svn origin/master
> Which is apparently not sufficient (or outdated?).
Indeed, that would be helpful.
Subject: [PATCH] git-svn(1): update instructions for resuming a git-svn clone

git-svn expects its references under refs/remotes/*; but these will not be copied or set by "git clone"; put in this man page the manual fiddling that is required with current git-svn to get this to work.

Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
---
 Documentation/git-svn.txt |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index e1a1d46..b1d527f 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -456,10 +456,13 @@ have each person clone that repository with 'git clone':
 ------------------------------------------------------------------------
 # Do the initial import on a server
 	ssh server "cd /pub && git-svn clone http://svn.foo.org/project
-# Clone locally
-	git clone server:/pub/project
-# Tell git-svn which branch contains the Subversion commits
-	git update-ref refs/remotes/git-svn origin/master
+# Clone locally - make sure the refs/remotes/ space matches the server
+	mkdir project
+	cd project
+	git-init
+	git remote add origin server:/pub/project
+	git config --add remote.origin.fetch=+refs/remotes/*:refs/remotes/*
+	git fetch
 # Initialize git-svn locally (be sure to use the same URL and -T/-b/-t options as were used on server)
 	git-svn init http://svn.foo.org/project
 # Pull the latest changes from Subversion
-- 
1.5.3.5
Previous: Eric Wong
Message 18 of 18 in “Odd number of elements in anonymous hash”
  1. Dennis SchriddeJan 8, 2008
  2. Junio C HamanoJan 8, 2008
  3. Dennis SchriddeJan 8, 2008
  4. Eric WongJan 10, 2008
  5. Dennis SchriddeJan 10, 2008
  6. Dennis SchriddeJan 10, 2008
  7. Junio C HamanoJan 10, 2008
  8. Dennis SchriddeJan 10, 2008
  9. Junio C HamanoJan 10, 2008
  10. git-svn: handle leading/trailing whitespace from svnsync revpropsEric Wong, Jan 12, 2008
  11. Junio C HamanoJan 12, 2008
  12. Eric WongJan 12, 2008
  13. Björn SteinbrinkJan 12, 2008
  14. Junio C HamanoJan 12, 2008
  15. Junio C HamanoJan 12, 2008
  16. Dennis SchriddeJan 12, 2008
  17. Eric WongJan 9, 2008
  18. Sam VilainJan 24, 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.