2 ms·
I’ve used submodules a lot, and choose not to use them, anymore. They are just too much work. I now use package managers to accomplish pretty much the same thin
by ChrisMarshallNY 2y ago
I’ve used submodules a lot, and choose not to use them, anymore. They are just too much work. I now use package managers to accomplish pretty much the same thing.
One project that I wrote, used nested submodules. There was a specific reason for the nesting, as it was a layered system, and each layer had a very specific context and functional domain, and submodules helped enforce that.
The problem was, it made changes a huge pain. If I made changes in the deeper layers, I’d need to propagate the changes throughout the entire chain, above. I wrote a few bash scripts to handle that, but it was fairly kludgy, and quite brittle.
I ended up just folding it all into a monorepo.
The one feature that I’d love to see in git, is something that Microsoft SourceSafe could do. I call it “Virtual Repos.”
You could make a “repo” that was actually an amalgam of files that were references to files in other repos. Their state in the virtual repo reflected their state in their “home” repo, and changes made in the virtual repo would go out to their home repo.
It must be a nightmare to get right, though. I can see why it would not be implemented, but these could be used for a lot of the same things that submodules are used for.
- arccy 2y agomaybe sparse checkouts would be analogous to virtual repos?
- ChrisMarshallNY 2y agoThey are similar. I remember cataloging the differences, once, but that was a long time ago. I don’t think sparse checkouts let you “mix and match,” the way virtual repos did. Think of the files in the virtual repo as “symlinks” to their originals, in other repos. Other than that, SourceSafe was kind of a nightmare, and I don’t miss it.