{"thread":{"id":"47378","subject":"[PATCH] Documentation/git-clone: improve description for submodule recursing","startedAt":"2017-12-05T02:53:45Z","lastAt":"2017-12-05T17:09:21Z","messageCount":2,"participants":["Stefan Beller","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"334131","messageId":"20171205025332.9835-1-sbeller@google.com","threadId":"47378","inReplyTo":null,"subject":"[PATCH] Documentation/git-clone: improve description for submodule recursing","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-12-05T02:53:32Z","receivedAt":"2017-12-05T02:53:45Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"There have been a few complaints on the mailing list that git-clone doesn't\nrespect the `submodule.recurse` setting, which every other command (that\npotentially knows how to deal with submodules) respects.  In case of clone\nthis is not beneficial to respect as the user may not want to obtain all\nsubmodules (assuming a pathspec of '.').\n\nImprove the documentation such that the pathspec is mentioned in the\nsynopsis to alleviate the confusion around the submodule recursion flag\nin git-clone.\n\nWhile at it clarify that the option can be given multiple times for complex\\\npathspecs.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n Documentation/git-clone.txt | 19 +++++++++++--------\n 1 file changed, 11 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\nindex 83c8e9b394..42ca7b5095 100644\n--- a/Documentation/git-clone.txt\n+++ b/Documentation/git-clone.txt\n@@ -14,7 +14,7 @@ SYNOPSIS\n \t  [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]\n \t  [--dissociate] [--separate-git-dir <git dir>]\n \t  [--depth <depth>] [--[no-]single-branch] [--no-tags]\n-\t  [--recurse-submodules] [--[no-]shallow-submodules]\n+\t  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]\n \t  [--jobs <n>] [--] <repository> [<directory>]\n \n DESCRIPTION\n@@ -231,14 +231,17 @@ branch of some repository for search indexing.\n \tAfter the clone is created, initialize and clone submodules\n \twithin based on the provided pathspec.  If no pathspec is\n \tprovided, all submodules are initialized and cloned.\n-\tSubmodules are initialized and cloned using their default\n-\tsettings.  The resulting clone has `submodule.active` set to\n+\tThis option can be given multiple times for pathspecs consisting\n+\tof multiple entries.  The resulting clone has `submodule.active` set to\n \tthe provided pathspec, or \".\" (meaning all submodules) if no\n-\tpathspec is provided.  This is equivalent to running\n-\t`git submodule update --init --recursive` immediately after\n-\tthe clone is finished. This option is ignored if the cloned\n-\trepository does not have a worktree/checkout (i.e. if any of\n-\t`--no-checkout`/`-n`, `--bare`, or `--mirror` is given)\n+\tpathspec is provided.\n++\n+Submodules are initialized and cloned using their default settings. This is\n+equivalent to running\n+`git submodule update --init --recursive <pathspec>` immediately after\n+the clone is finished. This option is ignored if the cloned repository does\n+not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,\n+or `--mirror` is given)\n \n --[no-]shallow-submodules::\n \tAll submodules which are cloned will be shallow with a depth of 1.\n-- \n2.15.0.531.g2ccb3012c9-goog\n\n"},{"id":"334197","messageId":"xmqqvahlhzk7.fsf@gitster.mtv.corp.google.com","threadId":"47378","inReplyTo":"20171205025332.9835-1-sbeller@google.com","subject":"Re: [PATCH] Documentation/git-clone: improve description for submodule recursing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-12-05T17:09:12Z","receivedAt":"2017-12-05T17:09:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> There have been a few complaints on the mailing list that git-clone doesn't\n> respect the `submodule.recurse` setting, which every other command (that\n> potentially knows how to deal with submodules) respects.  In case of clone\n> this is not beneficial to respect as the user may not want to obtain all\n> submodules (assuming a pathspec of '.').\n>\n> Improve the documentation such that the pathspec is mentioned in the\n> synopsis to alleviate the confusion around the submodule recursion flag\n> in git-clone.\n>\n> While at it clarify that the option can be given multiple times for complex\\\n> pathspecs.\n\nWell written (modulo the backslash there, which I can easily remove\nwhile queuing).\n\n>\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n>  Documentation/git-clone.txt | 19 +++++++++++--------\n>  1 file changed, 11 insertions(+), 8 deletions(-)\n>\n> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\n> index 83c8e9b394..42ca7b5095 100644\n> --- a/Documentation/git-clone.txt\n> +++ b/Documentation/git-clone.txt\n> @@ -14,7 +14,7 @@ SYNOPSIS\n>  \t  [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]\n>  \t  [--dissociate] [--separate-git-dir <git dir>]\n>  \t  [--depth <depth>] [--[no-]single-branch] [--no-tags]\n> -\t  [--recurse-submodules] [--[no-]shallow-submodules]\n> +\t  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]\n>  \t  [--jobs <n>] [--] <repository> [<directory>]\n>  \n>  DESCRIPTION\n> @@ -231,14 +231,17 @@ branch of some repository for search indexing.\n>  \tAfter the clone is created, initialize and clone submodules\n>  \twithin based on the provided pathspec.  If no pathspec is\n>  \tprovided, all submodules are initialized and cloned.\n> -\tSubmodules are initialized and cloned using their default\n> -\tsettings.  The resulting clone has `submodule.active` set to\n> +\tThis option can be given multiple times for pathspecs consisting\n> +\tof multiple entries.  The resulting clone has `submodule.active` set to\n>  \tthe provided pathspec, or \".\" (meaning all submodules) if no\n> -\tpathspec is provided.  This is equivalent to running\n> -\t`git submodule update --init --recursive` immediately after\n> -\tthe clone is finished. This option is ignored if the cloned\n> -\trepository does not have a worktree/checkout (i.e. if any of\n> -\t`--no-checkout`/`-n`, `--bare`, or `--mirror` is given)\n> +\tpathspec is provided.\n> ++\n> +Submodules are initialized and cloned using their default settings. This is\n> +equivalent to running\n> +`git submodule update --init --recursive <pathspec>` immediately after\n> +the clone is finished. This option is ignored if the cloned repository does\n> +not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,\n> +or `--mirror` is given)\n>  \n>  --[no-]shallow-submodules::\n>  \tAll submodules which are cloned will be shallow with a depth of 1.\n"}]}