threads / discuss / 24834

git-svn mirror in bare repo

Subject: git-svn mirror in bare repo

## tl;dr

5 messages between Aug 23, 2010 and Aug 28, 2010.

replies: 4people: 3as markdown or json

Enrico Weigelt· Aug 23, 2010, 12:24 UTC · lore
Hi folks,

is it possible to use git-svn w/ an bare repository (eg. using an temporary workdir when necessary or directly creating tree and commit objects w/o going through workdir at all) ?

I'm running a dozen of mirrors (also from cvs), some from fairly large and I'd like to get rid of the working copies.

cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Michael J Gruber· Aug 23, 2010, 12:58 UTC · re: Enrico Weigelt · lore

Re: git-svn mirror in bare repo

Enrico Weigelt venit, vidit, dixit 23.08.2010 14:24:
Show 6 quoted lines
> 
> Hi folks,
> 
> is it possible to use git-svn w/ an bare repository (eg. using
> an temporary workdir when necessary or directly creating tree
> and commit objects w/o going through workdir at all) ?
No.
> I'm running a dozen of mirrors (also from cvs), some from fairly
> large and I'd like to get rid of the working copies.

Your only option is a different conversion tool. GSoC resulted in a lot of code in this direction, but I'm not sure it can do without a workdir. It is based on svndump

Michael
Enrico Weigelt· Aug 23, 2010, 13:13 UTC · re: Michael J Gruber · lore

Re: git-svn mirror in bare repo

* Michael J Gruber <git@drmicha.warpmail.net> wrote:
Show 9 quoted lines
> Enrico Weigelt venit, vidit, dixit 23.08.2010 14:24:
> > 
> > Hi folks,
> > 
> > is it possible to use git-svn w/ an bare repository (eg. using
> > an temporary workdir when necessary or directly creating tree
> > and commit objects w/o going through workdir at all) ?
> 
> No.
hmm, can it work with an external workdir ?
Show 6 quoted lines
> > I'm running a dozen of mirrors (also from cvs), some from fairly
> > large and I'd like to get rid of the working copies.
> 
> Your only option is a different conversion tool. GSoC resulted in a lot
> of code in this direction, but I'm not sure it can do without a workdir.
> It is based on svndump

I guess that requires access to the raw repository (on the server), not just unprivileged svn client access, right ?

cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Michael J Gruber· Aug 23, 2010, 15:05 UTC · re: Enrico Weigelt · lore

Re: git-svn mirror in bare repo

Enrico Weigelt venit, vidit, dixit 23.08.2010 15:13:
Show 12 quoted lines
> * Michael J Gruber <git@drmicha.warpmail.net> wrote:
>> Enrico Weigelt venit, vidit, dixit 23.08.2010 14:24:
>>>
>>> Hi folks,
>>>
>>> is it possible to use git-svn w/ an bare repository (eg. using
>>> an temporary workdir when necessary or directly creating tree
>>> and commit objects w/o going through workdir at all) ?
>>
>> No.
> 
> hmm, can it work with an external workdir ?

You can have the workdir anywhere you like by using the core.worktree setting. So, if you mind the size requirements you can put it onto some fast tempdir (tmpfs, say). In fact, if all you do is "git svn fetch" then git svn may not even notice a missing worktree (would have to try). "git svn rebase" does need a worktree.

Show 10 quoted lines
> 
>>> I'm running a dozen of mirrors (also from cvs), some from fairly
>>> large and I'd like to get rid of the working copies.
>>
>> Your only option is a different conversion tool. GSoC resulted in a lot
>> of code in this direction, but I'm not sure it can do without a workdir.
>> It is based on svndump
> 
> I guess that requires access to the raw repository (on the server),
> not just unprivileged svn client access, right ?

In fact, Ram's GSoC project started off with svnrdump which is now part of the subversion code base (i.e. in their trunk). It is basically "svndump remote", i.e. a client outputting svn dump format.

Michael
P.S.: We usually keep cc's when replying here.
Wesley J. Landaker· Aug 28, 2010, 16:45 UTC · re: Enrico Weigelt · lore

Re: git-svn mirror in bare repo

On 08/23/2010 05:24 AM, Enrico Weigelt wrote:
Show 6 quoted lines
> is it possible to use git-svn w/ an bare repository (eg. using
> an temporary workdir when necessary or directly creating tree
> and commit objects w/o going through workdir at all) ?
> 
> I'm running a dozen of mirrors (also from cvs), some from fairly
> large and I'd like to get rid of the working copies.

When I have a large repository with git-svn that I only occasionally want to use the working copy of it, here is what I do:

1) git svn clone the SVN repository normally
2) Create an "empty" branch with no files ("git checkout --orphan")
When I want to update SVN, I do:
  git checkout trunk
  git svn rebase
  git checkout empty
When I want to push something to SVN I do:
  git checkout trunk
  git svn dcommit
  git checkout empty

This makes it work sort of like a bare repository, but it still works with git-svn. I use this when I have a bunch of SVN repositories I need to be able to work with quickly at any time, but I don't want to waste the disk space having all of their working copies checked out simultaneously.

← back to recent threads