git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Migrating from SVN
@ 2010-03-22 10:18 Christoph Bartoschek
  2010-03-25  6:22 ` Heiko Voigt
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Bartoschek @ 2010-03-22 10:18 UTC (permalink / raw)
  To: git

Hi,

we consider migrating from Subversion to Git. However we are not sure how to 
cleanly migrate the history from Subversion to Git. Till now we have such a 
structure in a single Subversion repository:

project_A
project_B
project_C
project_D
project_E

Via svn:externals we form two products:

product_1/project_A
          project_B
          project_C

product_2/project_B
          project_C
          project_D
          project_E

Now we are merging both products into one such that the structure should be 

product/project_A
        project_B
        project_C
        project_D
        project_E

I think this makes migration to Git easier as we can now work with only one 
Git repository. We also circumvent the usage of the unmature submodule 
support in Git.

How can I now import our Subversion projects into the Git repository such 
that for each project the history is kept and ideally the whole history is 
linearized by the subversion revision numbers?

Thanks
Christoph

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Migrating from SVN
  2010-03-22 10:18 Migrating from SVN Christoph Bartoschek
@ 2010-03-25  6:22 ` Heiko Voigt
  2010-03-26 11:15   ` Christoph Bartoschek
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Voigt @ 2010-03-25  6:22 UTC (permalink / raw)
  To: Christoph Bartoschek; +Cc: git

On Mon, Mar 22, 2010 at 11:18:18AM +0100, Christoph Bartoschek wrote:
> Now we are merging both products into one such that the structure should be 
> 
> product/project_A
>         project_B
>         project_C
>         project_D
>         project_E
> 
> I think this makes migration to Git easier as we can now work with only one 
> Git repository. We also circumvent the usage of the unmature submodule 
> support in Git.
> 
> How can I now import our Subversion projects into the Git repository such 
> that for each project the history is kept and ideally the whole history is 
> linearized by the subversion revision numbers?

Import them all seperately into git (e.g. using git svn) and then have a
look at subtree merge

http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html

to merge them all together. That way you will have seperate lines of
history for each project and one (or five) big merges on top.

AFAIK the revision number from svn is stored in the commit message if
you use git svn so to add the project name you might want to use git
filter-branch to add that name to each commit before merging the history
lines.

That way you will have all the history of the now seperate projects in
one git repository. Keep in mind that after doing that its not that easy
to make them seperate projects again.

Hope that helps.

cheers Heiko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Migrating from SVN
  2010-03-25  6:22 ` Heiko Voigt
@ 2010-03-26 11:15   ` Christoph Bartoschek
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Bartoschek @ 2010-03-26 11:15 UTC (permalink / raw)
  To: git

Heiko Voigt wrote:

> Import them all seperately into git (e.g. using git svn) and then have a
> look at subtree merge
> 
> http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-
subtree.html
> 
> to merge them all together. That way you will have seperate lines of
> history for each project and one (or five) big merges on top.
> 
> AFAIK the revision number from svn is stored in the commit message if
> you use git svn so to add the project name you might want to use git
> filter-branch to add that name to each commit before merging the history
> lines.
> 
> That way you will have all the history of the now seperate projects in
> one git repository. Keep in mind that after doing that its not that easy
> to make them seperate projects again.

Thanks for your suggestion. Unfortunately I do not want to have separate 
lines of history. 

For example if the subversion revisions are like this:

rev 0: Initial import
rev 1: Change in project_A
rev 2: Change in project_B
rev 3: Change in project_A
rev 4: Change in project_C

Then I would like to have in git for the product_1 line:

First commit: The commit consists of the initial import.

Second commit: The commit consists of rev 1 of project_A and rev 0 of 
project_B and rev 0 of project_C.

Third commit: The commit consists of rev 1 of project_A and rev 2 of 
project_B and rev 0 of project_C

Fourth commit: The commit consists of rev 3 of project_A and rev 2 of 
project_B and rev 0 of project_C.

Fifth commit: The commit consists of rev 3 of project_A and rev 2 of 
project_B and rev 4 of project_C.

This does not yet include branches. But how can I get a history like that in 
git?

A similar line of history would appear for product_2 and when they are 
merged, I can use a subtree merge as sugested to combine them. 

Christoph

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-26 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 10:18 Migrating from SVN Christoph Bartoschek
2010-03-25  6:22 ` Heiko Voigt
2010-03-26 11:15   ` Christoph Bartoschek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).