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

Re: [PATCH v2 2/6] submodule-config: add helper function to get 'fetch' config from .gitmodules

From
Antonio Ospite <ao2@ao2.it>
Date
Jun 26, 2018, 20:55 UTC
Message-ID
<20180626225505.7de21d73ce40af2247d3c084@ao2.it>
In-Reply-To
<xmqqfu19jojn.fsf@gitster-ct.c.googlers.com>

On Tue, 26 Jun 2018 13:11:40 -0700 Junio C Hamano <gitster@pobox.com> wrote:

Show 10 quoted lines
> Antonio Ospite <ao2@ao2.it> writes:
> 
> > Add a helper function to make it clearer that retrieving 'fetch'
> > configuration from the .gitmodules file is a special case supported
> > solely for backward compatibility purposes.
> > ...
> 
> Then perhaps the new public function deserves a comment stating
> that?
>
Hi Junio,

a comment about that is added to submodule-config.h in patch 4/6 in place of the comment about config_from_gitmodules.

I can add a note here as well if that one is not enough.
[...]
Show 10 quoted lines
> > +void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules)
> > +{
> > +	struct fetch_config config = {
> > +		.max_children = max_children,
> > +		.recurse_submodules = recurse_submodules
> > +	};
> 
> We started using designated initializers some time ago, and use of
> it improves readability of something like this ;-)
>

Ah, TBH I didn't even consider whether it was allowed in git code, I just used the construct out of habit.

Ciao,
   Antonio
-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
Previous: Junio C HamanoNext: Antonio Ospite
Message 10 of 14 in “Restrict the usage of config_from_gitmodules to submodule-config”
  1. 0/6 Restrict the usage of config_from_gitmodules to submodule-configAntonio Ospite, Jun 26, 2018
  2. 1/6 config: move config_from_gitmodules to submodule-config.cAntonio Ospite, Jun 26, 2018
  3. 6/6 submodule-config: reuse config_from_gitmodules in repo_read_gitmodulesAntonio Ospite, Jun 26, 2018
  4. 3/6 submodule-config: add helper to get 'update-clone' config from .gitmodulesAntonio Ospite, Jun 26, 2018
  5. 5/6 submodule-config: pass repository as argument to config_from_gitmodulesAntonio Ospite, Jun 26, 2018
  6. Junio C HamanoJun 26, 2018
  7. Antonio OspiteJun 26, 2018
  8. 2/6 submodule-config: add helper function to get 'fetch' config from .gitmodulesAntonio Ospite, Jun 26, 2018
  9. Junio C HamanoJun 26, 2018
  10. Antonio OspiteJun 26, 2018
  11. 4/6 submodule-config: make 'config_from_gitmodules' privateAntonio Ospite, Jun 26, 2018
  12. Junio C HamanoJun 26, 2018
  13. Brandon WilliamsJun 26, 2018
  14. Junio C HamanoJun 26, 2018

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.