How to organize git in projects with overlapping dependencies? -
currently working on converting monolithic svn repository (all applications , libraries in single repository) c++ code git repository. have organize libraries , applications in own repository.
i am, however, struggling find way handle internal (i.e. our own code) , overlapping dependencies. problem exists because many libraries , applications depend on each other - quite deep.
for instance, imagine following (quite simple) project structure:
- app1 depends on lib1 lib2
- lib1 depends on lib2 lib3
- lib2 depends on lib3
- lib3 not have dependencies
app1 game, lib1 graphics library, lib2 math library , lib3 utility library. keep in mind libraries used in many other applications , updated.
ideally want have situation following directory structure when clone app1:
- app1
- libs
- lib1
- lib2
- lib3
- libs
and following when clone, instance, lib2:
- lib2
- libs
- lib3
- libs
i have thought using git subtree or submodules, whereby each project records own dependencies. however, project directory layout become (for readability removed in-between libs directory):
- app1
- lib1
- lib2
- lib3
- lib3
- lib2
- lib2
- lib3
- lib1
as can see lib3 , lib2 placed in project multiple times. not desirable.
i solve writing custom script each application , library clones relevant dependent repositories. when becomes difficult keep track of exact state of code @ specific commit.
is there way handle internal , overlapping dependencies git? or struggling because trying achieve goes against way of doing things in git?
Comments
Post a Comment