submodule update: consistently document the '--checkout' option

Commit 322bb6e12f (add update 'none' flag to disable update of submodule by default) added the '--checkout' option to "git submodule update" but forgot to explicitly document it in synopsis, usage string and man page (It is only mentioned implicitly in the man page). In 23d25e48 (submodule: explicit local branch creation in module_clone) the synopsis of the man page was updated, but the "OPTIONS" section of the man page and the usage string of the git-submodule script still do not mention the '--checkout' option. Fix that by documenting this option in usage string and the "OPTIONS" section of man page too. While at it group the update-mode options into a single set in the usage string. Reported-by: Matthijs Kooijman <matthijs@stdin.nl> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jens Lehmann committed Feb 28, 2014 at 22:41 UTC 893a9764dc5e6d5d3432a47f595ffffade1edd9c
2 files changed +11 -2
Documentation/git-submodule.txt
+10 -1
@@ -15,7 +15,7 @@ SYNOPSIS
15 'git submodule' [--quiet] init [--] [<path>...]
16 'git submodule' [--quiet] deinit [-f|--force] [--] <path>...
17 'git submodule' [--quiet] update [--init] [--remote] [-N|--no-fetch]
18 - [-f|--force] [--rebase|--merge|--checkout] [--reference <repository>]
18 + [-f|--force] [--checkout|--rebase|--merge] [--reference <repository>]
19 [--depth <depth>] [--recursive] [--] [<path>...]
20 'git submodule' [--quiet] summary [--cached|--files] [(-n|--summary-limit) <n>]
21 [commit] [--] [<path>...]
@@ -305,6 +305,15 @@ SHA-1. If you don't want to fetch, you should use `submodule update
305 This option is only valid for the update command.
306 Don't fetch new objects from the remote site.
307
308 +--checkout::
309 + This option is only valid for the update command.
310 + Checkout the commit recorded in the superproject on a detached HEAD
311 + in the submodule. This is the default behavior, the main use of
312 + this option is to override `submodule.$name.update` when set to
313 + `merge`, `rebase` or `none`.
314 + If the key `submodule.$name.update` is either not explicitly set or
315 + set to `checkout`, this option is implicit.
316 +
317 --merge::
318 This option is only valid for the update command.
319 Merge the commit recorded in the superproject into the current branch
git-submodule.sh
+1 -1
@@ -9,7 +9,7 @@ USAGE="[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <re
9 or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]
10 or: $dashless [--quiet] init [--] [<path>...]
11 or: $dashless [--quiet] deinit [-f|--force] [--] <path>...
12 - or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]
12 + or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--reference <repository>] [--recursive] [--] [<path>...]
13 or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
14 or: $dashless [--quiet] foreach [--recursive] <command>
15 or: $dashless [--quiet] sync [--recursive] [--] [<path>...]"