threads / discuss / 29013

svn to git with non-standard layout

Subject: svn to git with non-standard layout

## tl;dr

5 messages between Nov 23, 2011 and Nov 23, 2011.

replies: 4people: 3as markdown or json

Bernd Schubert· Nov 23, 2011, 19:23 UTC · lore
Hi all,

we just want to migrate from subversion to git, but so far all attempts to do that resulted in missing commit information.

So we have an svn repo with multiple sub-repos. The trouble is now that those sub-repos have their own trunk/tags (no branches) directories, but actually those projects are very dependent on each other and lots of commits go to many sub-project in a single commit. So our new git repository shall meld all sub-projects into a new common repository.

So we have something like this:
svn-root -> main-project
             /       |    \
            /        |     \
           proj1    proj2   proj{n}
          /    \     /   \    /    \
         /      \   /     \  trunk  tags
        /       \ trunk   tags
        trunk   tags
                /   \
               tag1 tag{2...n}
I think the same issue has been asked a few times before, for example here:
http://comments.gmane.org/gmane.comp.version-control.git/163491

but I still do not know how to properly convert the old structure into a new global one. So we simply want to have:

branches,tags <- main-project -> {proj1, proj2, ..., projN}
I think the above link suggests something like
[svn-remote "svn"]
         url = https://some-repo-url
         fetch=/:refs/remotes/svnroot
         fetch = build_scripts/trunk:refs/remotes/build_scripts/trunk
         fetch = create_repos/trunk:refs/remotes/create_repos/trunk

When I'm going to to 'svn fetch' this, files from different projects are going to be in the same directory. But of course, the project directory structure is supposed to stay as it it.

Any ideas what I still could try to do?

Thanks, Bernd

Stephen Bash· Nov 23, 2011, 20:22 UTC · re: Bernd Schubert · lore

Re: svn to git with non-standard layout

----- Original Message -----
Show 17 quoted lines
> From: "Bernd Schubert" <bernd.schubert@itwm.fraunhofer.de>
> To: git@vger.kernel.org
> Sent: Wednesday, November 23, 2011 2:23:34 PM
> Subject: svn to git with non-standard layout
> 
> So we have something like this:
> 
> svn-root -> main-project
>              /       |    \
>             /        |     \
>            proj1    proj2   proj{n}
>           /    \     /   \    /    \
>          /      \   /     \  trunk  tags
>         /       \ trunk   tags
>         trunk   tags
>                 /   \
>                tag1 tag{2...n}
Just for clarification: are there files and/or directories in main-project that are not sub-projects?

Thanks, Stephen

Bernd Schubert· Nov 23, 2011, 20:52 UTC · re: Stephen Bash · lore

Re: svn to git with non-standard layout

On 11/23/2011 09:22 PM, Stephen Bash wrote:
Show 20 quoted lines
> ----- Original Message -----
>> From: "Bernd Schubert"<bernd.schubert@itwm.fraunhofer.de>
>> To: git@vger.kernel.org
>> Sent: Wednesday, November 23, 2011 2:23:34 PM
>> Subject: svn to git with non-standard layout
>>
>> So we have something like this:
>>
>> svn-root ->  main-project
>>               /       |    \
>>              /        |     \
>>             proj1    proj2   proj{n}
>>            /    \     /   \    /    \
>>           /      \   /     \  trunk  tags
>>          /       \ trunk   tags
>>          trunk   tags
>>                  /   \
>>                 tag1 tag{2...n}
>
> Just for clarification: are there files and/or directories in main-project that are not sub-projects?

Yes that as well, sorry, forgot to tell about this. If those should be troublesome, we might simply ignore them, as those are not that important to have a full history, though.

Thanks, Bernd

Frans Klaver· Nov 23, 2011, 21:19 UTC · re: Bernd Schubert · lore

Re: svn to git with non-standard layout

On Wed, 23 Nov 2011 20:23:34 +0100, Bernd Schubert <bernd.schubert@itwm.fraunhofer.de> wrote:

> we just want to migrate from subversion to git, but so far all attempts  
> to do that resulted in missing commit information.

What are all attempts? Did you try only git-svn, or did you try tools like svn2git?

> Any ideas what I still could try to do?

If you haven't tried anything other than git-svn, try svneverever & svn2git[1] for an actual repository conversion. Or have a look at the newest kid on the block called SubGit[2][3]. In both I don't have any experience, but of svn2git I know Qt and KDE have used it successfully to convert their repositories.

I assume both are somewhat more complex to use and set up than to simply use git-svn, but I guess it will be worth the effort.

Good luck, Frans

[1] http://techbase.kde.org/Projects/MoveToGit/UsingSvn2Git [2] http://subgit.com/ [3] http://thread.gmane.org/gmane.comp.version-control.git/185806

Bernd Schubert· Nov 23, 2011, 21:45 UTC · re: Frans Klaver · lore

Re: svn to git with non-standard layout

On 11/23/2011 10:19 PM, Frans Klaver wrote:
Show 8 quoted lines
> On Wed, 23 Nov 2011 20:23:34 +0100, Bernd Schubert
> <bernd.schubert@itwm.fraunhofer.de> wrote:
>
>> we just want to migrate from subversion to git, but so far all
>> attempts to do that resulted in missing commit information.
>
> What are all attempts? Did you try only git-svn, or did you try tools
> like svn2git?

We are trying to do this ever since Monday and it included svn2git as well. The problem with svn2git is that you can provide several tags and branch paths, but only a single trunk path.

Show 19 quoted lines
>
>
>> Any ideas what I still could try to do?
>
> If you haven't tried anything other than git-svn, try svneverever &
> svn2git[1] for an actual repository conversion. Or have a look at the
> newest kid on the block called SubGit[2][3]. In both I don't have any
> experience, but of svn2git I know Qt and KDE have used it successfully
> to convert their repositories.
>
> I assume both are somewhat more complex to use and set up than to simply
> use git-svn, but I guess it will be worth the effort.
>
> Good luck,
> Frans
>
> [1] http://techbase.kde.org/Projects/MoveToGit/UsingSvn2Git
> [2] http://subgit.com/
> [3] http://thread.gmane.org/gmane.comp.version-control.git/185806

Thanks, I'm going to read about svneverever and SubGit tomorrow. We will also try another tool that can convert an svn dump (once we get a dump, as we don't have easy access to the svn database).

Thanks, Bernd

← back to recent threads