git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Suggestions on how to reorganize and split up a monolithic repository?

From
MRMichael "Ray" Rehbein <mrrehbein@gmail.com>
Date
Aug 4, 2010, 19:08 UTC
Message-ID
<AANLkTikFrj6tyHfmZ8k-gmR+gAFyEGv+X+0x849eEaEP@mail.gmail.com>

Currently we have everything in one repository for our website, and are looking into splitting it up. The scale of one repository looks like it will be getting out of hand down the road.

General layout at the moment:

repos.git/Site1 repos.git/Site2 repos.git/Library/Ours repos.git/Library/3rdParty1 repos.git/Library/3rdParty2 repos.git/UnitTests/Ours repos.git/UnitTests/3rdParty1 repos.git/UnitTests/3rdParty2

Goals in splitting it up:
- Allow each site to have a collection of libraries that are known to
be working for it.  Sometimes an update to shared library to fix site1
will break site2.
- Allow a site to have only the needed libraries, to avoid bloating
the site, and help in identifying unused code.
One plan we started to go with was:

Site1.git/ Site1.git/Library/Ours - submodule link to OurLib.git/Library/Ours Site1.git/Library/3rdParty1 - submodule link to 3rdParty1Lib.git/Library/3rdParty1

OurLib.git/Library/Ours OurLib.git/UnitTests/Ours OurLib.git/Library/3rdParty1 - submodule link to 3rdParty1Lib.git/Library/3rdParty1

3rdParty1Lib.git/Library/3rdParty1 3rdParty1Lib.git/UnitTests/3rdParty1

But found out that git submodule doesn't actually allow mapping a section of a git repository, so changed it to:

Site1.git/ Site1.git/Library/Ours - symlink to submodule/OurLib/Library/Ours Site1.git/Library/3rdParty1 - symlink to submodule/3rdParty1Lib/Library/3rdParty1 Site1.git/submodule/OurLib - submodule OurLib.git Site1.git/submodule/3rdParty1Lib - submodule 3rdParty1Lib.git

OurLib.git/Library/Ours OurLib.git/UnitTests/Ours OurLib.git/Library/3rdParty1 - symlink to submodule/3rdParty1Lib/Library/3rdParty1 OurLib.git/submodule/3rdParty1Lib - submodule 3rdParty1Lib.git

3rdParty1Lib.git/Library/3rdParty1 3rdParty1Lib.git/UnitTests/3rdParty1

The 3rd Party Lib is not all 3rd party anymore, as we have tweaked it to fit better in our setup. Additionally, the 3rd party library didn't come with unit tests. One of the unit tests we wrote for our use of the 3rd party ended up with a use of our library. Putting a submodule of OurLib into 3rdParty1Lib would create recursive submodules, which is not something we want.

Is there a better way to organize this?
Message 1 of 1 in “Suggestions on how to reorganize and split up a monolithic repository?”
  1. Michael "Ray" RehbeinAug 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.