Submodules suck when you try to use them to actively contribute within those. However, as a basic dependency manager, they work just fine. That's what we're talking about here.
I want to use an OS X port, I'd something something like this:
- git clone https://github.com/HandmadeHero/osxrepo.git (not a real URL, just an example)
- git submodule update --init
At this point in time, I'd have something that looked like this:
| osxrepo/
handmadehero/ -- This is Casey's code
code/ ...
misc/ ...
code/ -- This is the OS X code
misc/
|
Make your modifications as you see fit. You won't be modifying anything within the handmadehero code at all.
This requires a couple of changes to the build file, namely:
- Replacing the win32_ file references with the platform.
- Adding the handmadehero as part of the include path for the compiler.
That's the basic idea. The benefit of this approach is that it doesn't require daily maintenance for this to work as long as the submodule is tracking the branch. Of course, this could bring in compiler errors from breaking changes in the platform layer.
There's not perfect solution for this. This is just one way that would work and have low overhead for all involved.