threads / discuss / 1592

SVN import

Subject: SVN import

## tl;dr

19 messages between Aug 19, 2005 and Oct 16, 2005.

replies: 18people: 5as markdown or json

Matthias Urlichs· Aug 19, 2005, 10:00 UTC · lore
Quick note: I'm working on importing from SVN.

My current main problem is that SVN's Perl interface leaks server connections (apparently nobody has used it for any real work yet), which is of course *bad*, and kindof prevents me from finishing the job today. :-/

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
I could certainly run a marvellous university here if only we didn't
have to have all these damn students underfoot all the time.
		-- Terry Pratchett (Hogfather)
Matthias Urlichs· Oct 10, 2005, 09:45 UTC · re: Matthias Urlichs · lore

Re: SVN import

Hi, Matthias Urlichs wrote:
> Quick note: I'm working on importing from SVN.
The first version seems to be finished.
http:/netz/smurf.noris.de/git/git.git, branch "svn".

Should be ready for merging, though I wouldn't say no to a few testers before that happens. ;-)

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Elfyn McBratney· Oct 10, 2005, 10:26 UTC · re: Matthias Urlichs · lore

Re: SVN import

On Mon, Oct 10, 2005 at 11:45:05 +0200, Matthias Urlichs wrote:
 > Hi, Matthias Urlichs wrote:
 > 
 > > Quick note: I'm working on importing from SVN.
 > 
 > The first version seems to be finished.
 > 
 > http:/netz/smurf.noris.de/git/git.git, branch "svn".
 > 
 > Should be ready for merging, though I wouldn't say no to a few testers
 > before that happens.  ;-)

Ah cool, was going to work on an SVN counterpart to git-{arch,cvs}import, but now won't have to. ;) Will test and report back. :)

Best, Elfyn

-- 
Elfyn McBratney
Gentoo Developer/Perl Team Lead
beu/irc.freenode.net                            http://dev.gentoo.org/~beu/
+------------O.o--------------------- http://dev.gentoo.org/~beu/pubkey.asc

PGP Key ID: 0x69DF17AD
PGP Key Fingerprint:
  DBD3 B756 ED58 B1B4 47B9  B3BD 8D41 E597 69DF 17AD
Matthias Urlichs· Oct 10, 2005, 11:04 UTC · re: Elfyn McBratney · lore

Re: SVN import

Hi,
Elfyn McBratney:
> Ah cool, was going to work on an SVN counterpart to git-{arch,cvs}import,
> but now won't have to. ;)  Will test and report back. :)
> 
Please do. I've just pushed a few fixes.
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
When competing for a section of road or a parking space, remember
that the vehicle in need of the most body work has the right-of-way.
		-- Massachusetts Driver Education Manual
Elfyn McBratney· Oct 10, 2005, 11:14 UTC · re: Elfyn McBratney · lore

Re: SVN import

On Mon, Oct 10, 2005 at 11:26:51AM +0100, Elfyn McBratney wrote:
 > On Mon, Oct 10, 2005 at 11:45:05 +0200, Matthias Urlichs wrote:
 >  > Hi, Matthias Urlichs wrote:
 >  > 
 >  > > Quick note: I'm working on importing from SVN.
 >  > 
 >  > The first version seems to be finished.
 >  > 
 >  > http:/netz/smurf.noris.de/git/git.git, branch "svn".
 >  > 
 >  > Should be ready for merging, though I wouldn't say no to a few testers
 >  > before that happens.  ;-)
 > 
 > Ah cool, was going to work on an SVN counterpart to git-{arch,cvs}import,
 > but now won't have to. ;)  Will test and report back. :)

Worth noting that the URL is actually: http://netz.smurf.noris.de/git/git.git ;)

Best, Elfyn

-- 
Elfyn McBratney
Gentoo Developer/Perl Team Lead
beu/irc.freenode.net                            http://dev.gentoo.org/~beu/
+------------O.o--------------------- http://dev.gentoo.org/~beu/pubkey.asc

PGP Key ID: 0x69DF17AD
PGP Key Fingerprint:
  DBD3 B756 ED58 B1B4 47B9  B3BD 8D41 E597 69DF 17AD
Matthias Urlichs· Oct 10, 2005, 11:39 UTC · re: Elfyn McBratney · lore

Re: SVN import

Hi,
Elfyn McBratney:
> Worth noting that the URL is actually:
> http://netz.smurf.noris.de/git/git.git ;)
> 
*Grumble*
NB: Worth noting: the importer actually *requires* a current Perl SVN
module (i.e., 1.2.1). Debian Sarge's version 1.1.4 doesn't work.
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
The best way to get rid of worries is to let them die of neglect.
Matthias Urlichs· Oct 10, 2005, 13:32 UTC · re: Matthias Urlichs · lore

Re: SVN import

Hi, Matthias Urlichs wrote:
Show 5 quoted lines
> Hi,
> 
> Elfyn McBratney:
>> Worth noting that the URL is actually:
>> http://netz.smurf.noris.de/git/git.git ;)

The current version seems to actually work with nontrivial repositories (I'm importing gnupg at the moment, which recently switched from CVS to SVN).

Also worth noting is that cvs->svn->git is somewhat more faithful WRT importing CVS archives with "incomplete" or "funky" tags -- it exports their state correctly to SVN, and my importer should be able to get them out again. On the minus side, the two cannot generate the same changesets because cvs2svn rounds timestamps to the next full minute.

Speed: Comparable to the CVS importer when crossing the network: both need
one roundtrip per file. I haven't done any tests with local repositories.
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Each morning puts a man on trial and each evening passes judgment.
					-- Roy L. Smith
Yasushi SHOJI· Oct 10, 2005, 17:48 UTC · re: Matthias Urlichs · lore

Re: SVN import

Hi Matthias,
Great work!

At Mon, 10 Oct 2005 11:45:05 +0200, Matthias Urlichs wrote:

> 
> > Quick note: I'm working on importing from SVN.
> 
> The first version seems to be finished.

just tried on my svn repo, which had flat directory but moved to trunk dir after. on that repo, the-current-just-pulled git-svnimport says:

    1: Unrecognized path: /main.c
to reproduce:
    svnadmin create --fs-type fsfs /tmp/repo
    svn co file:///tmp/repo test
    cd test
    touch main.c
    svn add main.c
    svn ci main.c -m 'testing svnimport'
    svn mkdir trunk
    svn move main.c trunk
    svn ci -m 'move main.c to trunk/'
    cd ..
    git-svnimport.perl -C /tmp/test.git -i -v file:///tmp/repo/
hope this helps,
--
          yashi
Matthias Urlichs· Oct 10, 2005, 18:13 UTC · re: Yasushi SHOJI · lore

Re: SVN import

Hi,
Yasushi SHOJI:
Show 5 quoted lines
> just tried on my svn repo, which had flat directory but moved to trunk
> dir after.  on that repo, the-current-just-pulled git-svnimport says:
> 
>     1: Unrecognized path: /main.c
> 

True. I could add an option which behaves as if everything that's not recognized is seen as being on the trunk, but ...

>     git-svnimport.perl -C /tmp/test.git -i -v file:///tmp/repo/
> 

Fixed in the last upload -- you get an -s2 option which skips the broken first check-in, and as a special bonus it manages not to skip the *last* version either. ;-)

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Be like a duck -- keep calm and unruffled on the surface but paddle like the
devil under water.
Yasushi SHOJI· Oct 10, 2005, 18:30 UTC · re: Matthias Urlichs · lore

Re: SVN import

At Mon, 10 Oct 2005 20:13:29 +0200, Matthias Urlichs wrote:

Show 9 quoted lines
> 
> Yasushi SHOJI:
> > just tried on my svn repo, which had flat directory but moved to trunk
> > dir after.  on that repo, the-current-just-pulled git-svnimport says:
> > 
> >     1: Unrecognized path: /main.c
> > 
> True. I could add an option which behaves as if everything that's not
> recognized is seen as being on the trunk, but ...

hmmm. can libsvn see those file had moved in to the trunk? don't know how 'svn mv' is treated in svn.

Show 5 quoted lines
> >     git-svnimport.perl -C /tmp/test.git -i -v file:///tmp/repo/
> > 
> Fixed in the last upload -- you get an -s2 option which skips the broken
> first check-in, and as a special bonus it manages not to skip the *last*
> version either. ;-)

thanks for quick fix. I was gonna report that one too but your fix own over my tying speed ;-)

# I guess I need to wait for mirroring script to catch up?
--
           yashi
Matthias Urlichs· Oct 10, 2005, 18:57 UTC · re: Yasushi SHOJI · lore

Re: SVN import

Hi,
Yasushi SHOJI:
Show 6 quoted lines
> > True. I could add an option which behaves as if everything that's not
> > recognized is seen as being on the trunk, but ...
> 
> hmmm. can libsvn see those file had moved in to the trunk?  don't know
> how 'svn mv' is treated in svn.
> 

see "svn log". The script sees the file, and where it comes from (but ignores that).

> # I guess I need to wait for mirroring script to catch up?

? it was uptodate when I wrote that mail; see http://netz.smurf.noris.de/cgi/gitweb?p=git.git;a=shortlog;h=svn

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
All intelligent species own cats.
Yasushi SHOJI· Oct 10, 2005, 20:21 UTC · re: Matthias Urlichs · lore

Re: SVN import

At Mon, 10 Oct 2005 20:57:30 +0200, Matthias Urlichs wrote:

Show 10 quoted lines
> 
> Yasushi SHOJI:
> > > True. I could add an option which behaves as if everything that's not
> > > recognized is seen as being on the trunk, but ...
> > 
> > hmmm. can libsvn see those file had moved in to the trunk?  don't know
> > how 'svn mv' is treated in svn.
> > 
> see "svn log". The script sees the file, and where it comes from (but
> ignores that).

well, if it can, it'd be nice if svnimport could handle those files. ;-)

anyway, here is another one if you are interested in. svnimport doesn't seems to handle -t option, or what am i missing?

    svnadmin create --fs-type fsfs /tmp/repo
    svn co file:///tmp/repo test
    cd test
    svn mkdir foo
    echo hello > foo/hello.c
    svn add foo/hello.c
    svn ci -m 'add hello.c'
    cd ..
    git-svnimport.perl -t foo -s2 -C /tmp/test.git -i -v file:///tmp/repo
    DONE; creating master branch
    cp: cannot stat `/tmp/test.git/.git/refs/heads/origin': No such file or directory
--
          yashi
Matthias Urlichs· Oct 10, 2005, 20:52 UTC · re: Yasushi SHOJI · lore

Re: SVN import

Hi,
Yasushi SHOJI:
> anyway, here is another one if you are interested in.  svnimport
> doesn't seems to handle -t option, or what am i missing?
> 

At first glance: you're only doing one check-in, which the -s2 option therefore conveniently skips. git-svnimport therefore does nothing. ;-)

NB: Please put thpse svn scripts into a bunch of testcases, and send me a
    patch...
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
"When a man is tired of Ankh-Morpork, he is tired of ankle-deep slurry."
		-- Terry Pratchett (Mort)
Kalle Valo· Oct 15, 2005, 20:32 UTC · re: Matthias Urlichs · lore

Re: SVN import

Matthias Urlichs <smurf@smurf.noris.de> writes:
Show 8 quoted lines
>> Quick note: I'm working on importing from SVN.
>
> The first version seems to be finished.
>
> http:/netz/smurf.noris.de/git/git.git, branch "svn".
>
> Should be ready for merging, though I wouldn't say no to a few testers
> before that happens.  ;-)

After fixing a conflict and a typo in Makefile (patch coming soon) I tested this with the bcm43xx driver from svn://svn.berlios.de/bcm43xx/trunk. It seems to work fine.

Only a minor problem was that I immediately didn't realize the 100 commit limit was intentional. Maybe the error message could improved a bit. Now it says:

        Exiting due to a memory leak. Repeat, please.
Maybe something like this would be more informative:
        Subversion commit limit reached (to avoid SVN library memory
        leaks). Exiting, but please repeat the command and it will
        continue safely.

But in overall this is a really useful addition to git, I hope it will be merged soon.

-- 
Kalle Valo
Kalle Valo· Oct 15, 2005, 20:44 UTC · re: Kalle Valo · lore

svnimport: fixed Makefile entry

Makefile entry for git-svnimport contained a small typo.
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

applies-to: b5467f815f8de270a755099df924bff5ed98512e bce2921cf6fe774ba4f8edffe35ef914c2a836e6

diff --git a/Makefile b/Makefile
index 8f2dfb2..1cca928 100644
--- a/Makefile
+++ b/Makefile
@@ -94,7 +94,7 @@ SCRIPT_SH = \
 SCRIPT_PERL = \
 	git-archimport.perl git-cvsimport.perl git-relink.perl \
 	git-rename.perl git-shortlog.perl git-fmt-merge-msg.perl \
-	git-findtags.perl git-svnimport-perl
+	git-findtags.perl git-svnimport.perl
 
 SCRIPT_PYTHON = \
 	git-merge-recursive.py
---
0.99.8.GIT
Junio C Hamano· Oct 16, 2005, 07:48 UTC · re: Kalle Valo · lore

Re: SVN import

Kalle Valo <Kalle.Valo@iki.fi> writes:
> But in overall this is a really useful addition to git, I hope it will
> be merged soon.

Matthias, how ready do you feel the code is? Whenever you are ready, please just holler.

You seem to have a small cvsimport updates in the branch. Mind feeding it to me independently?

Matthias Urlichs· Oct 16, 2005, 17:42 UTC · re: Junio C Hamano · lore

Re: SVN import

Hi,
Junio C Hamano:
> Matthias, how ready do you feel the code is?  Whenever you are
> ready, please just holler.
> 
Hollering now.

There's one small omission, which is that the merge RX for SVN should optionally recognize the SVN commit number it's merging from and use the corresponsing git commit as the merge parent, but maybe somebody else feels motivated to add that (hint, hint) .

> You seem to have a small cvsimport updates in the branch.  Mind
> feeding it to me independently?
> 

Why? It already is a separate commit (89764f5d..., the one before I added the svn script).

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
The Public is merely a multiplied "me."
		-- Mark Twain
Junio C Hamano· Oct 16, 2005, 18:09 UTC · re: Matthias Urlichs · lore

Re: SVN import

Matthias Urlichs <smurf@smurf.noris.de> writes:
> Why? It already is a separate commit (89764f5d..., the one before
> I added the svn script).

That was a "just in case you need a bit more time for the full merge of your SVN work" question. Pulling the whole thing now.

Matthias Urlichs· Oct 16, 2005, 17:58 UTC · re: Kalle Valo · lore

Re: SVN import

Hi,
> Maybe something like this would be more informative:
> 
Thanks; reworded.
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Never put off till run-time what you can do at compile-time.
		-- D. Gries

← back to recent threads