I have a big project containing multiple Git submodules. A main project uses a collection of different libraries and some libraries use libraries themself. All libraries are useable in a standonlone fashion, so they all need a submodule containing the test infrastructure (VUnit and UVVM).
The tree of Git submodules looks like this:
ProjectA
o- libA
o- UVVM
o- VUnit
o- libB
o- UVVM
o- VUnit
o- libC
o- libA
o- UVVM
o- VUnit
o- UVVM
o- VUnit
o- libD
o- UVVM
o- VUnit
o- UVVM
o- VUnit
I have some knowledge of Git's internal database and linking structure. So the BLOBs of the submodules are stored in the .git
directory of the main repository in a directory called modules
. They have usually the same symbolic name as the submodules directory name.
A submodule points to its database main directory with a .git
file containing the relative path. In return the submodules database's config file points to the submodule's working tree.
So it would be possible that all UVVM submodules point to the same database, but how is it possible that a database points to multiple working trees?
I found the Git extension to work with multiple working dirs, but does it also work with submodules like in my case?
I'm also open for other suggestions.
Edit 1:
This is the generated internal structure in the .git
directory. It creates on full object storage per submodule for UVVM and VUnit over and over again.
.git/
modules/
libA/
modules/
UVVM/
VUnit/
libB/
modules/
UVVM/
VUnit/
libC/
modules/
libA/
modules/
UVVM/
VUnit/
UVVM/
VUnit/
libD/
modules/
UVVM/
VUnit/
UVVM/
VUnit/
The memory footprint on the server is very low, because all submodules point to the same repository. But the memory footprint on the client side is very high.