threads / discuss / 10258

Workflow: split repository?

Subject: Workflow: split repository?

## tl;dr

3 messages between Oct 12, 2007 and Oct 12, 2007.

replies: 2people: 2as markdown or json

Jan Wielemaker· Oct 12, 2007, 12:21 UTC · lore
Hi,

I've got a big active project, until yesterday managed using CVS. As with any distributed academic research project the repository has become a nice mess where most files are in the wrong place and there are several almost independent sub-projects living in directories.

The plan is/was to
	* Convert everything to GIT (done, through cvs2svn)
	* Everyone keeps hacking on their bits, while one is starting
	to reorganise the structure by moving files and directories
	and changing import headers, and other file references in
	a GIT branch.
	* Now we merge the continued work and the reorganisation to
	end up with a nice clean hierarchy :-)
	* Split the big project into multiple projects.  One of the
	reasons is that we want to make part of them public.  Others
	we cannot publish as they contain copyrighted data.  I understand
	we can reunite them using GIT sub modules.
Does this make sense?

While splitting we want to *loose* history information for some of the projects. That is easy: simply create a new repository from the current files. For some however we would like to *preserve* the history. This means we would like to pick a hierarchy with its history. After quite a bit of reading, I get the impression this cannot be done. Am I right?

Is the only way to create a GIT repositiory right away from a subset of the CVS for which we want to preserve the history?

	Thanks --- Jan
Jan Hudec· Oct 12, 2007, 14:30 UTC · re: Jan Wielemaker · lore

Re: Workflow: split repository?

On Fri, Oct 12, 2007 at 14:21:39 +0200, Jan Wielemaker wrote:
Show 22 quoted lines
> Hi,
> 
> I've got a big active project, until yesterday managed using CVS. As
> with any distributed academic research project the repository has become
> a nice mess where most files are in the wrong place and there are
> several almost independent sub-projects living in directories.
> 
> The plan is/was to
> 
> 	* Convert everything to GIT (done, through cvs2svn)
> 	* Everyone keeps hacking on their bits, while one is starting
> 	to reorganise the structure by moving files and directories
> 	and changing import headers, and other file references in
> 	a GIT branch.
> 	* Now we merge the continued work and the reorganisation to
> 	end up with a nice clean hierarchy :-)
> 	* Split the big project into multiple projects.  One of the
> 	reasons is that we want to make part of them public.  Others
> 	we cannot publish as they contain copyrighted data.  I understand
> 	we can reunite them using GIT sub modules.
> 
> Does this make sense?

It might make more sense to convert bit by bit, to separate git repositories. Would save you some git-filter-branch work.

Show 5 quoted lines
> While splitting we want to *loose* history information for some of the
> projects.  That is easy: simply create a new repository from the current
> files.  For some however we would like to *preserve* the history.  This
> means we would like to pick a hierarchy with its history.  After quite
> a bit of reading, I get the impression this cannot be done.  Am I right?

It can, but you have to be aware of the pitfalls. Git allows you to create a new history, which is defined modification of the original history. There is git-filter-branch command, that can create a repository with just a subtree and such. But it's a new, independent, history. You can't merge between the old and new one (but you can rebase the few commits someone made while you were converting) and anyone who has the old history in his repo will still have it.

> Is the only way to create a GIT repositiory right away from a subset of
> the CVS for which we want to preserve the history?

No, it's not. It will save you work if you can do as much splitting as possible during the conversion, ie. convert the bits you know will be separate separately (and combine them using submodules as appropriate).

But if you have bits that will take a lot of work to factor out, you can convert to git, make the other code ready to use a submodule and than use git-filter-branch to extract the right bits of history for the submodule.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Jan Wielemaker· Oct 12, 2007, 14:57 UTC · re: Jan Hudec · lore

Re: Workflow: split repository?

Hi Jan,
On Friday 12 October 2007 16:30, Jan Hudec wrote:
Show 5 quoted lines
> On Fri, Oct 12, 2007 at 14:21:39 +0200, Jan Wielemaker wrote:
> > Does this make sense?
>
> It might make more sense to convert bit by bit, to separate git
> repositories. Would save you some git-filter-branch work.
Show 10 quoted lines
> > Is the only way to create a GIT repositiory right away from a subset of
> > the CVS for which we want to preserve the history?
>
> No, it's not. It will save you work if you can do as much splitting as
> possible during the conversion, ie. convert the bits you know will be
> separate separately (and combine them using submodules as appropriate).
>
> But if you have bits that will take a lot of work to factor out, you can
> convert to git, make the other code ready to use a submodule and than use
> git-filter-branch to extract the right bits of history for the submodule.

Thanks! git-filter-branch looks a bit overwhelming, but I think I can manage :-) I'll do the simple things in separate conversions.

	Cheers --- Jan

← back to recent threads