Source code organization (on an multi-program scale)
Posted: Wed Jun 24, 2009 11:15 pm
Currently, I have the entirety of my OS project, complete with necessary pieces for bootup (mostly drivers - it's a microkernel) and (eventually) the base system, all in separate directories within one common Git repository. I like the BSD model of developing the entire system together so things are consistent, which is why I initially wanted to keep things together like this.
However, I'm worried that if other people eventually join the project, having all the pieces of the OS in the same repository tree will become unwieldy; even though some pieces are very interdependent, other pieces are not, and I can't completely predict the dependency of each piece on the others yet. I don't want to have the revision history of the toolchain mixed up with the userland mixed up with the kernel and drivers. It also might be helpful to be able to download and compile each piece separately, even if I don't think the source code size will balloon much.
But conversely, I definitely want some pieces to be developed together, and having a common revision history would be helpful in those cases for debugging. For example, (as a future user) if a core format or library had to change *right now*, I could make sure the entire system was up to date by getting the latest system source tarball and updating everything at once.
Is it possible to properly manage such a setup using the features of Git? I could see having a branch for each sub-project, but still share a common master source tree - bugs could be tracked through the entire revision history tree, and everything would remain together for the end user. If this isn't fully possible or has some unforseen side effects, what would be a better organization of my project? If there is a better organization, how could I rearrange things within the repository without losing my revision history? (Even if this is not the case, it may be helpful for others to know for future reference.)
However, I'm worried that if other people eventually join the project, having all the pieces of the OS in the same repository tree will become unwieldy; even though some pieces are very interdependent, other pieces are not, and I can't completely predict the dependency of each piece on the others yet. I don't want to have the revision history of the toolchain mixed up with the userland mixed up with the kernel and drivers. It also might be helpful to be able to download and compile each piece separately, even if I don't think the source code size will balloon much.
But conversely, I definitely want some pieces to be developed together, and having a common revision history would be helpful in those cases for debugging. For example, (as a future user) if a core format or library had to change *right now*, I could make sure the entire system was up to date by getting the latest system source tarball and updating everything at once.
Is it possible to properly manage such a setup using the features of Git? I could see having a branch for each sub-project, but still share a common master source tree - bugs could be tracked through the entire revision history tree, and everything would remain together for the end user. If this isn't fully possible or has some unforseen side effects, what would be a better organization of my project? If there is a better organization, how could I rearrange things within the repository without losing my revision history? (Even if this is not the case, it may be helpful for others to know for future reference.)