Skip to content

Commit 893a976

Browse files
jlehmanngitster
authored andcommitted
submodule update: consistently document the '--checkout' option
Commit 322bb6e (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 23d25e4 (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 <[email protected]> Signed-off-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 23d25e4 commit 893a976

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Documentation/git-submodule.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SYNOPSIS
1515
'git submodule' [--quiet] init [--] [<path>...]
1616
'git submodule' [--quiet] deinit [-f|--force] [--] <path>...
1717
'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>]
1919
[--depth <depth>] [--recursive] [--] [<path>...]
2020
'git submodule' [--quiet] summary [--cached|--files] [(-n|--summary-limit) <n>]
2121
[commit] [--] [<path>...]
@@ -305,6 +305,15 @@ SHA-1. If you don't want to fetch, you should use `submodule update
305305
This option is only valid for the update command.
306306
Don't fetch new objects from the remote site.
307307

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+
308317
--merge::
309318
This option is only valid for the update command.
310319
Merge the commit recorded in the superproject into the current branch

git-submodule.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ USAGE="[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <re
99
or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]
1010
or: $dashless [--quiet] init [--] [<path>...]
1111
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>...]
1313
or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
1414
or: $dashless [--quiet] foreach [--recursive] <command>
1515
or: $dashless [--quiet] sync [--recursive] [--] [<path>...]"

0 commit comments

Comments
 (0)