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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> Antonio Ospite <ao2@xxxxxx> 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.

[...]
> > +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?



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux