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

Re: [PATCH 4/6] submodule--helper: improve logic for fallback remote name

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 17, 2025, 13:30 UTC
Message-ID
<xmqqecvixzov.fsf@gitster.g>
In-Reply-To
<20250610-jk-submodule-helper-use-url-v1-4-6d14c1504e91@gmail.com>
Jacob Keller <jacob.e.keller@intel.com> writes:
Show 10 quoted lines
> diff --git a/remote.h b/remote.h
> index 7e4943ae3a70ecefa3332d211084762ca30b59b6..ef0de4aa64e9ccd32cc2eea076c00386dcba1161 100644
> --- a/remote.h
> +++ b/remote.h
> @@ -338,6 +338,8 @@ const char *remote_for_branch(struct branch *branch, int *explicit);
>  const char *pushremote_for_branch(struct branch *branch, int *explicit);
>  char *remote_ref_for_branch(struct branch *branch, int for_push);
>  
> +const char *repo_default_remote(struct repository *repo);
> +

This breaks "make hdr-check" because nobody up to this point mentions "struct repository".

It seems doing an opaque forward declaration is in vogue at least in this file?

 remote.h | 1 +
 1 file changed, 1 insertion(+)
diff --git c/remote.h w/remote.h
index ef0de4aa64..86020ae2d3 100644
--- c/remote.h
+++ w/remote.h
@@ -9,6 +9,7 @@
 
 struct option;
 struct transport_ls_refs_options;
+struct repository;
 
 /**
  * The API gives access to the configuration related to remotes. It handles
Previous: Jacob KellerNext: Jacob Keller
Message 9 of 17 in “submodule: improve remote lookup logic”
  1. 0/6 submodule: improve remote lookup logicJacob Keller, Jun 11, 2025
  2. 1/6 dir: move starts_with_dot(_dot)_slash to dir.hJacob Keller, Jun 11, 2025
  3. 2/6 remote: remove the_repository from some functionsJacob Keller, Jun 11, 2025
  4. 3/6 remote: check branch->merge before access in branch_releaseJacob Keller, Jun 11, 2025
  5. 4/6 submodule--helper: improve logic for fallback remote nameJacob Keller, Jun 11, 2025
  6. Lidong YanJun 17, 2025
  7. Jacob KellerJun 17, 2025
  8. Jacob KellerJun 17, 2025
  9. Junio C HamanoJun 17, 2025
  10. 5/6 submodule: move get_default_remote_submodule()Jacob Keller, Jun 11, 2025
  11. 6/6 submodule: look up remotes by URL firstJacob Keller, Jun 11, 2025
  12. Jacob KellerJun 16, 2025
  13. Junio C HamanoJun 16, 2025
  14. Jacob KellerJun 16, 2025
  15. Junio C HamanoJun 17, 2025
  16. Junio C HamanoJun 17, 2025
  17. Jacob KellerJun 17, 2025

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.