1
0
mirror of https://github.com/git/git.git synced 2024-09-28 12:21:46 +02:00

submodule update documentation: don't repeat ourselves

The documentation for the `git submodule update` command, repeats itself
for each update option, "This is done when <option> is given, or no
option is given and `submodule.<name>.update` is set to <string>.

Avoid these repetitive clauses by stating the command line options take
precedence over configured options.

Also add 'none' to the list of options instead of mentioning it in the
following running text and split the list into two parts, one that is
accessible via the command line and one that is only reachable via the
configuration variables.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller 2016-12-27 15:43:09 -08:00 committed by Junio C Hamano
parent eb2f2f5f6a
commit fc01a5d26a

View File

@ -154,13 +154,13 @@ Update the registered submodules to match what the superproject
expects by cloning missing submodules and updating the working tree of expects by cloning missing submodules and updating the working tree of
the submodules. The "updating" can be done in several ways depending the submodules. The "updating" can be done in several ways depending
on command line options and the value of `submodule.<name>.update` on command line options and the value of `submodule.<name>.update`
configuration variable. Supported update procedures are: configuration variable. The command line option takes precedence over
the configuration variable. if neither is given, a checkout is performed.
update procedures supported both from the command line as well as setting
`submodule.<name>.update`:
checkout;; the commit recorded in the superproject will be checkout;; the commit recorded in the superproject will be
checked out in the submodule on a detached HEAD. This is checked out in the submodule on a detached HEAD.
done when `--checkout` option is given, or no option is
given, and `submodule.<name>.update` is unset, or if it is
set to 'checkout'.
+ +
If `--force` is specified, the submodule will be checked out (using If `--force` is specified, the submodule will be checked out (using
`git checkout --force` if appropriate), even if the commit specified `git checkout --force` if appropriate), even if the commit specified
@ -168,23 +168,21 @@ in the index of the containing repository already matches the commit
checked out in the submodule. checked out in the submodule.
rebase;; the current branch of the submodule will be rebased rebase;; the current branch of the submodule will be rebased
onto the commit recorded in the superproject. This is done onto the commit recorded in the superproject.
when `--rebase` option is given, or no option is given, and
`submodule.<name>.update` is set to 'rebase'.
merge;; the commit recorded in the superproject will be merged merge;; the commit recorded in the superproject will be merged
into the current branch in the submodule. This is done into the current branch in the submodule.
when `--merge` option is given, or no option is given, and
`submodule.<name>.update` is set to 'merge'. The following procedures are only available via the `submodule.<name>.update`
configuration variable:
custom command;; arbitrary shell command that takes a single custom command;; arbitrary shell command that takes a single
argument (the sha1 of the commit recorded in the argument (the sha1 of the commit recorded in the
superproject) is executed. This is done when no option is superproject) is executed. When `submodule.<name>.update`
given, and `submodule.<name>.update` has the form of is set to '!command', the remainder after the exclamation mark
'!command'. is the custom command.
When no option is given and `submodule.<name>.update` is set to 'none', none;; the submodule is not updated.
the submodule is not updated.
If the submodule is not yet initialized, and you just want to use the If the submodule is not yet initialized, and you just want to use the
setting as stored in .gitmodules, you can automatically initialize the setting as stored in .gitmodules, you can automatically initialize the