Re: [PATCH v3 06/10] submodule update: add `--init-active` switch
- From
- Brandon Williams <bmwill@google.com>
- Date
- Mar 15, 2017, 21:42 UTC
- Message-ID
- <20170315214227.GD159137@google.com>
- In-Reply-To
- <xmqqr31ziroz.fsf@gitster.mtv.corp.google.com>
On 03/14, Junio C Hamano wrote:
Show 24 quoted lines
> Brandon Williams <bmwill@google.com> writes:
>
> > +static void module_list_active(struct module_list *list)
> > +{
> > + int i;
> > +
> > + if (read_cache() < 0)
> > + die(_("index file corrupt"));
> > +
> > + gitmodules_config();
> > +
> > + for (i = 0; i < active_nr; i++) {
> > + const struct cache_entry *ce = active_cache[i];
> > +
> > + if (!S_ISGITLINK(ce->ce_mode) ||
> > + !is_submodule_initialized(ce->name))
> > + continue;
>
> This, because "is_submodule_initialized()" is not "is it
> initialized?" but "is it interesting?", will catch a submodule
> that used to be uninteresting but has become interesting (e.g. a new
> submodule added to somewhere in "lib/" when submodule.active lists
> "lib/" as one of the pathspecs to match interesting submodules) and
> automatically updates it.Yes, is_submodule_initialized should be renamed to something more descriptive (is_submodule_active, or something) in a follow on series because it is doing a check to see which submodule's the user finds interesting.
-- Brandon Williams