git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Chris Packham <judge.packham@gmail.com>,
	Sverre Rabbelier <srabbelier@gmail.com>,
	Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH] clone: Add the  --recurse-submodules option as alias for --recursive
Date: Thu, 04 Nov 2010 21:27:12 +0100	[thread overview]
Message-ID: <4CD31720.7080104@web.de> (raw)
In-Reply-To: <7vbp66vxuw.fsf@alter.siamese.dyndns.org>

Since 1.6.5 "git clone" honors the --recursive option to recursively check
out submodules too. As this option can easily be misinterpreted when it is
added to other commands like "git grep", add the new --recurse-submodules
option as an alias for --recursive so the same option can be used for all
commands recursing into submodules.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---

Am 03.11.2010 23:36, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
> 
>> ... For my first recursion patches a
>> few months ago I started with --recurse-submodules but then I noticed
>> that "git clone" already used "--recursive" for the same purpose, and
>> for consistency reasons I switched to using that too. But especially
>> when looking at recursive grep it is really easy to misinterpret
>> --recursive, so the idea came up to use --recurse-submodules everywhere.
>>
>> Opinions?
> 
> I think it would make sense to _add_ --recurse-submodules to "clone" to
> make everybody consistent.
> ... I
> thing it is too strong to _deprecate_ the option in the context of that
> command.

Fine by me, then what about this patch?

And am I right to assume that there are no objections against using
--recurse-submodule for fetch, checkout & friends?


 Documentation/git-clone.txt |    4 +++-
 builtin/clone.c             |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index ab72933..d69984b 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -12,7 +12,8 @@ SYNOPSIS
 'git clone' [--template=<template_directory>]
 	  [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
 	  [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
-	  [--depth <depth>] [--recursive] [--] <repository> [<directory>]
+	  [--depth <depth>] [--recursive|--recurse-submodules] [--] <repository>
+	  [<directory>]

 DESCRIPTION
 -----------
@@ -167,6 +168,7 @@ objects from the source repository into a pack in the cloned repository.
 	as patches.

 --recursive::
+--recurse-submodules::
 	After the clone is created, initialize all submodules within,
 	using their default settings. This is equivalent to running
 	`git submodule update --init --recursive` immediately after
diff --git a/builtin/clone.c b/builtin/clone.c
index 19ed640..61e0989 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -66,6 +66,8 @@ static struct option builtin_clone_options[] = {
 		    "setup as shared repository"),
 	OPT_BOOLEAN(0, "recursive", &option_recursive,
 		    "initialize submodules in the clone"),
+	OPT_BOOLEAN(0, "recurse_submodules", &option_recursive,
+		    "initialize submodules in the clone"),
 	OPT_STRING(0, "template", &option_template, "path",
 		   "path the template repository"),
 	OPT_STRING(0, "reference", &option_reference, "repo",
-- 
1.7.3.2.194.ge0b67

      reply	other threads:[~2010-11-04 20:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03 18:41 [RFC PATCH] clone: Deprecate the --recursive option in favor of --recurse-submodules Jens Lehmann
2010-11-03 22:13 ` Jakub Narebski
2010-11-03 22:24   ` Sverre Rabbelier
2010-11-03 22:36 ` Junio C Hamano
2010-11-04 20:27   ` Jens Lehmann [this message]

Reply instructions:

You may reply publicly 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

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

  git send-email \
    --in-reply-to=4CD31720.7080104@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=judge.packham@gmail.com \
    --cc=srabbelier@gmail.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).