logoalt Hacker News

pixl97 • yesterday at 5:28 PM • 4 replies • view on HN

Submodules are a mistake.


Replies

mort96 • yesterday at 5:33 PM

They're the best way we have to reference other repositories from one repository. All other solutions don't have the benefit of being built in to git and having support built in to all git forges.

Ecosystems like Yocto are built around having meta layers as submodules. And, despite the usability flaws of submodules, it works really well.

I also use submodules to include dependencies into C++ projects a lot. It works fine.

➕ show 1 reply
ghusto • yesterday at 6:46 PM

I won't defend submodules, but I also don't accept this as a response because it's irrelevant. They are used and it will be an unbearable pain when they break.

purpleidea • yesterday at 5:43 PM

> Submodules are a mistake.

Someone started this FUD a long time ago and it has worked. Instead of using an elegant mechanism, project have built inelegant wrappers on top of git like go.mod which are actual mistakes.

➕ show 2 replies
pphysch • yesterday at 5:32 PM

I find them extremely useful. It gives me a monorepo experience in repos that otherwise aren't/can't exist as one monorepo for various reasons.