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

Re: [PATCH] branch: improve advice when --recurse-submodules fails

From
Glen Choo <chooglen@google.com>
Date
Jan 18, 2023, 21:58 UTC
Message-ID
<kl6lo7qvo67h.fsf@chooglen-macbookpro.roam.corp.google.com>
In-Reply-To
<pull.1464.git.1673890908453.gitgitgadget@gmail.com>
"Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 10 quoted lines
> From: Philippe Blain <levraiphilippeblain@gmail.com>
>
> 'git branch --recurse-submodules start from-here' fails if any submodule
> present in 'from-here' is not yet cloned (under
> submodule.propagateBranches=true). We then give this advice:
>
>    "You may try updating the submodules using 'git checkout from-here && git submodule update --init'"
>
> If 'submodule.recurse' is set, 'git checkout from-here' will also fail since
> it will try to recursively checkout the submodules.
Ah, yes that is true.
Show 14 quoted lines
> diff --git a/branch.c b/branch.c
> index d182756827f..e5614b53b36 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -756,7 +756,7 @@ void create_branches_recursively(struct repository *r, const char *name,
>  				_("submodule '%s': unable to find submodule"),
>  				submodule_entry_list.entries[i].submodule->name);
>  			if (advice_enabled(ADVICE_SUBMODULES_NOT_UPDATED))
> -				advise(_("You may try updating the submodules using 'git checkout %s && git submodule update --init'"),
> +				advise(_("You may try updating the submodules using 'git checkout --no-recurse-submodules %s && git submodule update --init'"),
>  				       start_commitish);
>  			exit(code);
>  		}
>
Makes sense. Thanks!
Reviewed-by: Glen Choo <chooglen@google.com>
Previous: Philippe Blain via GitGitGadget
Message 2 of 2 in “branch: improve advice when --recurse-submodules fails”
  1. branch: improve advice when --recurse-submodules failsPhilippe Blain via GitGitGadget, Jan 16, 2023
  2. Glen ChooJan 18, 2023

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.