Skip to content

Commit fc01a5d

Browse files
stefanbellergitster
authored andcommitted
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>
1 parent eb2f2f5 commit fc01a5d

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

Documentation/git-submodule.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -154,37 +154,35 @@ Update the registered submodules to match what the superproject
154154
expects by cloning missing submodules and updating the working tree of
155155
the submodules. The "updating" can be done in several ways depending
156156
on command line options and the value of `submodule.<name>.update`
157-
configuration variable. Supported update procedures are:
157+
configuration variable. The command line option takes precedence over
158+
the configuration variable. if neither is given, a checkout is performed.
159+
update procedures supported both from the command line as well as setting
160+
`submodule.<name>.update`:
158161

159162
checkout;; the commit recorded in the superproject will be
160-
checked out in the submodule on a detached HEAD. This is
161-
done when `--checkout` option is given, or no option is
162-
given, and `submodule.<name>.update` is unset, or if it is
163-
set to 'checkout'.
163+
checked out in the submodule on a detached HEAD.
164164
+
165165
If `--force` is specified, the submodule will be checked out (using
166166
`git checkout --force` if appropriate), even if the commit specified
167167
in the index of the containing repository already matches the commit
168168
checked out in the submodule.
169169

170170
rebase;; the current branch of the submodule will be rebased
171-
onto the commit recorded in the superproject. This is done
172-
when `--rebase` option is given, or no option is given, and
173-
`submodule.<name>.update` is set to 'rebase'.
171+
onto the commit recorded in the superproject.
174172

175173
merge;; the commit recorded in the superproject will be merged
176-
into the current branch in the submodule. This is done
177-
when `--merge` option is given, or no option is given, and
178-
`submodule.<name>.update` is set to 'merge'.
174+
into the current branch in the submodule.
175+
176+
The following procedures are only available via the `submodule.<name>.update`
177+
configuration variable:
179178

180179
custom command;; arbitrary shell command that takes a single
181180
argument (the sha1 of the commit recorded in the
182-
superproject) is executed. This is done when no option is
183-
given, and `submodule.<name>.update` has the form of
184-
'!command'.
181+
superproject) is executed. When `submodule.<name>.update`
182+
is set to '!command', the remainder after the exclamation mark
183+
is the custom command.
185184

186-
When no option is given and `submodule.<name>.update` is set to 'none',
187-
the submodule is not updated.
185+
none;; the submodule is not updated.
188186

189187
If the submodule is not yet initialized, and you just want to use the
190188
setting as stored in .gitmodules, you can automatically initialize the

0 commit comments

Comments
 (0)