git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Documentation/git-clone: improve description for submodule recursing
Date: Tue, 05 Dec 2017 09:09:12 -0800
Message-ID: <xmqqvahlhzk7.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20171205025332.9835-1-sbeller@google.com>

Stefan Beller <sbeller@google.com> writes:

> There have been a few complaints on the mailing list that git-clone doesn't
> respect the `submodule.recurse` setting, which every other command (that
> potentially knows how to deal with submodules) respects.  In case of clone
> this is not beneficial to respect as the user may not want to obtain all
> submodules (assuming a pathspec of '.').
>
> Improve the documentation such that the pathspec is mentioned in the
> synopsis to alleviate the confusion around the submodule recursion flag
> in git-clone.
>
> While at it clarify that the option can be given multiple times for complex\
> pathspecs.

Well written (modulo the backslash there, which I can easily remove
while queuing).

>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  Documentation/git-clone.txt | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
> index 83c8e9b394..42ca7b5095 100644
> --- a/Documentation/git-clone.txt
> +++ b/Documentation/git-clone.txt
> @@ -14,7 +14,7 @@ SYNOPSIS
>  	  [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
>  	  [--dissociate] [--separate-git-dir <git dir>]
>  	  [--depth <depth>] [--[no-]single-branch] [--no-tags]
> -	  [--recurse-submodules] [--[no-]shallow-submodules]
> +	  [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
>  	  [--jobs <n>] [--] <repository> [<directory>]
>  
>  DESCRIPTION
> @@ -231,14 +231,17 @@ branch of some repository for search indexing.
>  	After the clone is created, initialize and clone submodules
>  	within based on the provided pathspec.  If no pathspec is
>  	provided, all submodules are initialized and cloned.
> -	Submodules are initialized and cloned using their default
> -	settings.  The resulting clone has `submodule.active` set to
> +	This option can be given multiple times for pathspecs consisting
> +	of multiple entries.  The resulting clone has `submodule.active` set to
>  	the provided pathspec, or "." (meaning all submodules) if no
> -	pathspec is provided.  This is equivalent to running
> -	`git submodule update --init --recursive` immediately after
> -	the clone is finished. This option is ignored if the cloned
> -	repository does not have a worktree/checkout (i.e. if any of
> -	`--no-checkout`/`-n`, `--bare`, or `--mirror` is given)
> +	pathspec is provided.
> ++
> +Submodules are initialized and cloned using their default settings. This is
> +equivalent to running
> +`git submodule update --init --recursive <pathspec>` immediately after
> +the clone is finished. This option is ignored if the cloned repository does
> +not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,
> +or `--mirror` is given)
>  
>  --[no-]shallow-submodules::
>  	All submodules which are cloned will be shallow with a depth of 1.

      reply index

Thread overview: 2+ messages in thread (expand / mbox.gz / Atom feed / [top])
2017-12-05  2:53 Stefan Beller
2017-12-05 17:09 ` Junio C Hamano [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply to all the recipients using the --to, --cc,
  and --in-reply-to switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqvahlhzk7.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox