News for hackers. Stuff that matters.
Re:Git Submodules: Adding, Using, Removing, Updating (2009) by dataflow on Wednesday February 17, 2021 @07:32AM (#26165644)
Yeah, I agree. At some point in time I came up with a clear rule on when exactly submodules are the best solution, and it was such a narrow set of circumstances that I forget what it was at this point. I think it might have been in situations similar to Boost, where the project is actually modular? I forget. But even in those cases the friction is painful. (For the life of me I don't understand why they don't try to polish all the rough edges. Anyone know?)

One alternative solution I like: have a build tool that pulls dependencies in automatically. Bazel supports this natively, but I've also done this in plain ol' Make. Like you can build download rules for deps/github.com/% to automatically pull from GitHub, and the rest of the script can just treat them like local files. Having the build tool take care of it often seems to fit the problem space better too.

Re:Git Submodules: Adding, Using, Removing, Updating (2009) by coryrc on Wednesday February 17, 2021 @11:53AM (#26168513)
Your later half is essentially what subtree does, but it can also merge changes if you have any.
Re:Git Submodules: Adding, Using, Removing, Updating (2009) by dataflow on Wednesday February 17, 2021 @04:08PM (#26171803)
Wait really? I thought subtree stores a copy of the other repo?
Re:Git Submodules: Adding, Using, Removing, Updating (2009) by coryrc on Thursday February 18, 2021 @12:03PM (#26182394)
Maybe I misunderstood and you aren't checking in those files, in which case it isn't the same.