... | ... | @@ -91,13 +91,21 @@ By default, git will consider your submodule as "dirty" when you do `git status` |
|
|
It's very important to keep in mind that Git submodules track commits (i.e. not branches!) to avoid getting confused. Therefore, `git submodule update` will result in submodules having checked out a so-called [ detached HEAD](http://alblue.bandlem.com/2011/08/git-tip-of-week-detached-heads.html).
|
|
|
|
|
|
|
|
|
|
|
|
So, in order to make change to a submodule you can either:
|
|
|
|
|
|
|
|
|
>
|
|
|
>
|
|
|
> 1) Work directly on the detached HEAD in the submodule directory.
|
|
|
>
|
|
|
>
|
|
|
|
|
|
>
|
|
|
>
|
|
|
> 2) Checkout the respective branch the commit is supposed to be pointed at from (normally `master`. See the table on [Repositories](repositories) for the full branch/repo summary).
|
|
|
>
|
|
|
>
|
|
|
|
|
|
|
|
|
If you merely need to update a submodule to point to the latest upstream commit of that submodule, which also takes care to lookup the proper upstream Git branch (in case it's not `master`) as specified in the `.gitmodules` file.
|
... | ... | @@ -149,7 +157,9 @@ git add util/haddock |
|
|
git add testsuite/...
|
|
|
|
|
|
# prepare a commit, and make sure to mention the string `submodule` in the commit message
|
|
|
git commit -m 'update haddock submodule ... blablabla'# for the paranoid, inspect your commit one last time, including the submodule's commit headings
|
|
|
git commit -m 'update haddock submodule ... blablabla'
|
|
|
|
|
|
# for the paranoid, inspect your commit one last time, including the submodule's commit headings
|
|
|
git show --submodule
|
|
|
|
|
|
# finally, push the commit to the remote `ghc.git` repo
|
... | ... | @@ -172,16 +182,27 @@ TODO show how to define a `git pushall` alias in the style of the `git pullall` |
|
|
### Validation hooks
|
|
|
|
|
|
|
|
|
There are server-side validation hooks in place on `git.haskell.org` to make sure for non-`wip/` branches that `ghc.git` never points to non-existing commits. Also, as a safe-guard against accidental submodule reference updates, the string `submodule`**\*must occur somewhere in commit messages of commits**\* updating submodule references. So just remember that:
|
|
|
|
|
|
There are server-side validation hooks in place on `git.haskell.org` to make sure for non-`wip/` branches that `ghc.git` never points to non-existing commits. Also, as a safe-guard against accidental submodule reference updates, the string `submodule` **\*must occur somewhere in commit messages of commits**\* updating submodule references. So just remember that:
|
|
|
|
|
|
|
|
|
>
|
|
|
>
|
|
|
> 1) If you update a submodule pointer,
|
|
|
>
|
|
|
>
|
|
|
|
|
|
>
|
|
|
>
|
|
|
> 2) You had to have pushed it upstream already,
|
|
|
>
|
|
|
>
|
|
|
|
|
|
>
|
|
|
>
|
|
|
> 3) And you have to say the word 'submodule' in the commit.
|
|
|
>
|
|
|
>
|
|
|
|
|
|
## Upstream repositories
|
|
|
|
... | ... | |