git submoduletrackw...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] git submoduletrackworld

8 Posts
7 Users
0 Reactions
89 Views
Posts: 7076
Full Member
Topic starter
 

Has anyone here used git submodules for real, in a production environment?

I was just on a call with a well known git server vendor, and it felt like they were gently trying to steer us away from them.

So I got to wondering if anyone has ever actually used them successfully?

We have some blobs of code that feel like they would be much happier as separate items, but the additional pain could get really nasty - how do you do things like reviewing and then atomically committing a change across multiple submodules?

I guess I could ask on the git mailing list, but I figured that I would get a much better answer on STW.


 
Posted : 02/07/2020 7:09 pm
Posts: 981
Free Member
 

Absoluely dreadful, dont do it!


 
Posted : 02/07/2020 7:11 pm
Posts: 981
Free Member
 

what language is this? most of them have their own package manager that you could use for this sort of thing. Theres also monorepo tools eg https://github.com/lerna/lerna


 
Posted : 02/07/2020 7:12 pm
Posts: 356
Full Member
 

I've used them. They can be a bit of a pain if the submodule contains rapidly changing code; because you effectively commit the commit hash of the submodule repo. So if it changes; you need to update your submodule then add a commit to update the reference.

On the other hand it means the version of the submodule stays static unless someone specifically updates the reference.

What technology are you using in the submodule ? Would you be better with a private nuget package / cocoapo / maven repo (or whatever is in the submodule 😉 )

Also "atomically committing a change across all modules" - probably means you are better off with a monorepo; unless you can split the process and version your sub modules cleanly


 
Posted : 02/07/2020 7:15 pm
Posts: 7076
Full Member
Topic starter
 

Code is mostly C, C++. Some of the code that's in the submodules is nice and standalone with a completely disjoint life cycle, but some, well, isn't. History.


 
Posted : 02/07/2020 7:58 pm
Posts: 1862
Free Member
 

submodules are pretty unpleasant. So is git-repo. git-subtree is horrible. I still need to try git-subrepo though.


 
Posted : 02/07/2020 9:53 pm
Posts: 6690
Free Member
 

We use them to develop automotive stuff in C++ and it's going into production.

Seem to work ok if people know what they're doing. I wasn't involved in the setup though, so no idea what the pros/cons are.


 
Posted : 03/07/2020 9:33 am
Posts: 4166
Free Member
 

what language is this?

my thoughts entirely. It looks like English but I can't get the words to mean anything. Who's the git?


 
Posted : 03/07/2020 9:48 am
Posts: 349
Free Member
 

I agree with stevehine. I think they make sense you have stuff that you want to reuse across different projects but not so much just for code separation IMO.

Also “atomically committing a change across all modules” – probably means you are better off with a monorepo

+1 to that too.

Oh, also repo might do you want - https://source.android.com/setup/develop/repo. We use it for bringing together a load of different projects into a single build.


 
Posted : 03/07/2020 10:11 am

6 DAYS LEFT
We are currently at 95% of our target!