... | ... | @@ -86,6 +86,34 @@ Here's a tentative plan: |
|
|
|
|
|
## The perspective on submodules
|
|
|
|
|
|
## Submodules
|
|
|
|
|
|
|
|
|
Things that work:
|
|
|
|
|
|
- when cloning a new repo, the submodules do point to the right place (the submodules of the parent)
|
|
|
- `git status` shows when a submodule is "dirty" (has local changes or new commits)
|
|
|
- `git diff` shows diffs in submodules too
|
|
|
- `git submodule status` tells you which local submodules have changes (+ at the beginning of the line)
|
|
|
|
|
|
|
|
|
Gotchas:
|
|
|
|
|
|
- after `git pull`, you need to do `git submodule update`
|
|
|
- submodules are detached by default, so you must `git checkout master` before you can commit (you don't find out until you push)
|
|
|
- `git submodule update` detaches the local submodules from whatever branch they were on. So if you had done `git checkout master` and committed local changes, the local changes are now invisible (but still stored in the repo). Alternatively, you can use `git submodule update --merge` or `git submodule update --rebase`. Neither seem like a good default.
|
|
|
- if you had local uncommitted changes in a submodule, then `git submodule update` refuses to update the submodule. Then your repo is in a state where it appears you have a local change to the submodule, this could be confusing.
|
|
|
- need to `git submodule init` before you can `git submodule update` in a new tree (or use `git submodule update --init`)
|
|
|
- have to push to submodules before pushing GHC, otherwise other users will not be able to do `git submodule update`.
|
|
|
- every submodule commit needs to be accompanied by a GHC commit (not clear if this is really a disadvantage, but it's more work and there will be many more commits).
|
|
|
|
|
|
### Google repo
|
|
|
|
|
|
|
|
|
Google has a tool called [ repo](https://sites.google.com/a/android.com/opensource/download/using-repo) that they use for managing the Android repositories, which is basically the same as our `darcs-all` script but is much much larger (it probably does a bit more, to be fair). It is written in Python and the list of git repositories is kept in an XML file.
|
|
|
|
|
|
### Older comments
|
|
|
|
|
|
|
|
|
Submodules do not really seem to be designed for what we want to do (work on a cohesive set of components that are developed together): they seem more suited to tracking upstream branches that you do not modify locally.
|
|
|
|
... | ... | |