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

Re: [PATCH 2/4] branch: give submodule updating advice before exit

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2022, 21:15 UTC
Message-ID
<xmqqa6d76t2c.fsf@gitster.g>
In-Reply-To
<f21d283e5ade542b73cb36178c3c33008e2c67df.1648584079.git.gitgitgadget@gmail.com>
"Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 30 quoted lines
> From: Glen Choo <chooglen@google.com>
>
> Fix a bug where "hint:" was printed _before_ "fatal:" (instead of the
> other way around).
>
> Signed-off-by: Glen Choo <chooglen@google.com>
> ---
>  branch.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/branch.c b/branch.c
> index 7377b9f451a..133e6047bc6 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -607,11 +607,13 @@ void create_branches_recursively(struct repository *r, const char *name,
>  	 */
>  	for (i = 0; i < submodule_entry_list.entry_nr; i++) {
>  		if (submodule_entry_list.entries[i].repo == NULL) {
> +			int code = die_message(
> +				_("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'"),
>  				       start_commitish);
> -			die(_("submodule '%s': unable to find submodule"),
> -			    submodule_entry_list.entries[i].submodule->name);
> +			exit(code);
>  		}
>  
>  		if (submodule_create_branch(
Great.
Thanks.
Previous: Glen Choo via GitGitGadgetNext: Glen Choo via GitGitGadget
Message 6 of 21 in “branch --recurse-submodules: Bug fixes and clean ups”
  1. 0/4 branch --recurse-submodules: Bug fixes and clean upsGlen Choo via GitGitGadget, Mar 29, 2022
  2. 1/4 branch: support more tracking modes when recursingGlen Choo via GitGitGadget, Mar 29, 2022
  3. Junio C HamanoMar 30, 2022
  4. Glen ChooMar 30, 2022
  5. 2/4 branch: give submodule updating advice before exitGlen Choo via GitGitGadget, Mar 29, 2022
  6. Junio C HamanoMar 30, 2022
  7. 3/4 branch --set-upstream-to: be consistent when advisingGlen Choo via GitGitGadget, Mar 29, 2022
  8. Ævar Arnfjörð BjarmasonMar 30, 2022
  9. Glen ChooMar 31, 2022
  10. 4/4 branch: remove negative exit codeGlen Choo via GitGitGadget, Mar 29, 2022
  11. 0/4 branch --recurse-submodules: Bug fixes and clean upsGlen Choo via GitGitGadget, Mar 31, 2022
  12. 1/4 branch: support more tracking modes when recursingGlen Choo via GitGitGadget, Mar 31, 2022
  13. 2/4 branch: give submodule updating advice before exitGlen Choo via GitGitGadget, Mar 31, 2022
  14. 3/4 branch --set-upstream-to: be consistent when advisingGlen Choo via GitGitGadget, Mar 31, 2022
  15. 4/4 branch: remove negative exit codeGlen Choo via GitGitGadget, Mar 31, 2022
  16. Junio C HamanoMar 31, 2022
  17. 1/2 branch: rework comments for future developersJunio C Hamano, Mar 31, 2022
  18. 2/2 branch.c: simplify advice-and-die sequenceJunio C Hamano, Mar 31, 2022
  19. Ævar Arnfjörð BjarmasonApr 1, 2022
  20. Glen ChooApr 1, 2022
  21. Junio C HamanoApr 1, 2022

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.