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

Re: How to use git-svn to clone from a mirror?

From
David Kastrup <dak@gnu.org>
Date
Jun 5, 2007, 06:41 UTC
Message-ID
<86r6oqoqdd.fsf@lola.quinscape.zz>
In-Reply-To
<Pine.LNX.4.64.0706041906570.4046@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 38 quoted lines
> On Mon, 4 Jun 2007, Raja R Harinath wrote:
>
>> David Kastrup <dak@gnu.org> writes:
>> 
>> > I have used something like
>> >
>> > git-svn clone -T trunk -b branches -t tags file:///tmp/rsync-mirror
>> >
>> > to clone an rsync mirror of an SVN repository.  Now I want to have 
>> > fetch revert to pulling from the upstream repository in future. 
>> > However, if I change the respective line in .git/config to 
>> > svn://the.svn.link/whatever, git-rebase will fetch the right updates, 
>> > but then says that it can't work with the objects in the git 
>> > repository.
>> >
>> > Changing the config back will make git-rebase -l work.
>> >
>> > So what would be the right procedure to shift the SVN source from an
>> > rsync mirror to the original, without git-svn breaking?
>> 
>> I think you'll have to
>> 
>> -------------8<------------
>>   # remove stored revision db, since we're going to change all the commit ids
>>   rm .git/svn/git-svn/.rev_db.*
>> 
>>   # rewrite git-svn-id: lines
>>   cg-admin-rewritehist \
>> 	--msg-filter \
>> 	'sed "s,file:///tmp/rsync-mirror,svn://the.svn.link/whatever,"'
>> 
>>   # recreate new revision db, and fetch updates, if any
>>   git-svn rebase
>> -------------8<------------
>
> <shameless plug>
> 	Or you use the just-rewritten version of it, git-filter-branch.
> </shameless>

Well, part of the reason I worked from an rsynced copy was to be able to repeat the experiment by just wasting a few hours of time each time, without wasting more bandwidth.

What I arrived at was to use
git-svn init -T trunk -t tags -b branches
  --rewrite-root svn://tug.org/texlive file:///mirror/texlive
git-svn fetch --all
[edit .git/config and replace the url and rewrite-root lines with a
 single url line pointing to the root]
git-reset --hard   [don't ask me why]
and afterwards fetches worked online.

I liked the commit messages when using --no-metadata better than with --rewrite-root, but I found no way to get the resulting archive operative for git-svn rebase afterwards.

Could someone explain to me why git needs to know the upstream URL history, whether by --rewrite-root or rewrite-hist or git-filter-branch?

I find this rather hard to understand, so I would like to get an idea where this fits naturally into the overall design of git, and how it makes sense.

Thanks,
-- 
David Kastrup
Previous: Johannes SchindelinNext: Eric Wong
Message 5 of 6 in “How to use git-svn to clone from a mirror?”
  1. David KastrupJun 2, 2007
  2. Raja R HarinathJun 4, 2007
  3. Does git-svn-id need repository path? (Re: How to use git-svn to clone from a mirror?)Jan Hudec, Jun 4, 2007
  4. Johannes SchindelinJun 4, 2007
  5. David KastrupJun 5, 2007
  6. Eric WongJun 5, 2007

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.