Re: [PATCH v3 06/10] submodule update: add `--init-active` switch

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

 



On 03/14, Junio C Hamano wrote:
> Brandon Williams <bmwill@xxxxxxxxxx> 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



[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]