git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Glen Choo <chooglen@google.com>
To: Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Cc: Philippe Blain <levraiphilippeblain@gmail.com>
Subject: Re: [PATCH] branch: improve advice when --recurse-submodules fails
Date: Wed, 18 Jan 2023 13:58:42 -0800	[thread overview]
Message-ID: <kl6lo7qvo67h.fsf@chooglen-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <pull.1464.git.1673890908453.gitgitgadget@gmail.com>

"Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:

> 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.

> 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>

      reply	other threads:[~2023-01-18 21:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16 17:41 [PATCH] branch: improve advice when --recurse-submodules fails Philippe Blain via GitGitGadget
2023-01-18 21:58 ` Glen Choo [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

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

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

  git send-email \
    --in-reply-to=kl6lo7qvo67h.fsf@chooglen-macbookpro.roam.corp.google.com \
    --to=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=levraiphilippeblain@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).