git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] clone: reorder --recursive/--recurse-submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 16, 2020, 21:28 UTC
Message-ID
<20200316212857.259093-3-gitster@pobox.com>
In-Reply-To
<20200316212857.259093-1-gitster@pobox.com>

The previous step made an option that is an alias to another option identify itself as an alias to the latter. Because it is easier to scan the list when a pointer goes backward to what a reader already has seen, mention "recurse-submodules" first with its true short help string, and then "recurse" with the statement that it is a synonym to "recurse-submodules".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 The history of --recursive/--recurse-submodules options dates back
 to ccdd3da6 (clone: add the --recurse-submodules option as alias
 for --recursive, 2010-11-04), where we decided to encourage use of
 more descriptive "--recurse-submodules" over "--recursive" which
 does not say to what extent the process is allowed to recurse.
 Documentation/git-clone.txt mentions only "--recurse-submodules"
 for this exact reason, and it may not be a bad idea to start
 planning to deprecate the alias "--recursive".  
 But that obviously is a separate topic.
 builtin/clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index 1ad26f4d8c..54b0acbe73 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -102,10 +102,10 @@ static struct option builtin_clone_options[] = {
 		    N_("don't use local hardlinks, always copy")),
 	OPT_BOOL('s', "shared", &option_shared,
 		    N_("setup as shared repository")),
-	OPT_ALIAS(0, "recursive", "recurse-submodules"),
 	{ OPTION_CALLBACK, 0, "recurse-submodules", &option_recurse_submodules,
 	  N_("pathspec"), N_("initialize submodules in the clone"),
 	  PARSE_OPT_OPTARG, recurse_submodules_cb, (intptr_t)"." },
+	OPT_ALIAS(0, "recursive", "recurse-submodules"),
 	OPT_INTEGER('j', "jobs", &max_jobs,
 		    N_("number of submodules cloned in parallel")),
 	OPT_STRING(0, "template", &option_template, N_("template-directory"),
-- 
2.26.0-rc1-11-g30e9940356
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 6 in “I keep typing "git log --no-mailmap" X-<”
  1. 0/3 I keep typing "git log --no-mailmap" X-<Junio C Hamano, Mar 16, 2020
  2. 2/3 clone: reorder --recursive/--recurse-submodulesJunio C Hamano, Mar 16, 2020
  3. 1/3 parse-options: teach "git cmd -h" to show alias as aliasJunio C Hamano, Mar 16, 2020
  4. 3/3 log: give --[no-]use-mailmap a more sensible synonym --[no-]mailmapJunio C Hamano, Mar 16, 2020
  5. Eric SunshineMar 16, 2020
  6. Junio C HamanoMar 16, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.