Git submodules vs dependency management?
Asked Answered
A

1

6

Where I work, we use a tool called apache Ivy for dependency management. However, I have recently been working on a project of my own with multiple repositories, therefore, I am using a git superproject to maintain all of them. The git submodules has been great for me and so far I strongly prefer them over Ivy. Here are the main things I like about them over Ivy:

  • Anytime you make a changes to two or more repositories that are dependent on each other, you can just commit to the superproject so it is apparent what is dependent on what. In Ivy, you have to do an entirely new release which is annoying.
  • It is much easier to track your changes better in a superproject. To my knowledge, Ivy doesn't keep very good track of you changes to a release.
  • Git has much more support than Ivy
  • You only have to understand one tool, GIT!!!

However, my company refuses to touch git submodules/superprojects. I have also been doing some research and it appears that a lot of people do not like git submodules and it is not considered good as a "dependency management" tool. Can anyone help me understand why?

Abri answered 7/3, 2018 at 0:52 Comment(6)
Git's submodules traditionally sucked a lot, in part because the in-Git support was really poor back in the days of Git 1.5 and earlier. It has improved a lot but I have not tried to use it since then. It would be interesting to see if others have had good experiences with it.Goodwin
I've recently used it and still hate it. Especially if there are multiple developers and branches in the super projects. It's fine if you're alone or with small group. It becomes a mess in any other scenario...Deferral
Which languages are you using? Compiled/interpreted?Galbanum
for my project at home: java, arduino (c++, c). for work: python mainly.Abri
I find this post, git-project-dependencies, maybe is a good guidance to your question.Ashley
git submodules is NOT a dependency management tool, unless you write some really complicated push/pull/fetch/commit hooksInsulate
G
6

Probably the killer feature of dependency managers like Apache Ivy is transitive dependencies resolution and conflict management. This is not doable using git submodules.

From Apache Ivy features page:

Imagine a component that's often reused by a software team, and that this component has dependencies of its own. Without a good dependency management tool, each time this component is reused, all its dependencies must be repeated. With Apache Ivy, it's different: simply write a dependency file once for the component, and benefit from the work already done anytime this component is reuse.

Another features that I consider important are:

  • downloads already compiled packages, instead of having to compile them every time

  • dependencies reports

That all said, I would only suggest git submodules when your dependency tree is shallow and compiling dependencies code is cheap.

Galbanum answered 7/3, 2018 at 1:26 Comment(2)
When your tree is really what? I think you lost a word.Feverish
@Feverish I think he meant "shallow". I've corrected it.Wrinkle

© 2022 - 2024 — McMap. All rights reserved.