Re: [PATCH 4/8] submodule-config: introduce parse_generic_submodule_config

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

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

>> The same comment as in the footnote for the review on [3/8] applies
>> here.
>
> Ok, so we want to have
>
>     [section ""]
>
> and
>
>     [section]
>
> be different, such that we could have a submodule with an "" name,
> but still be able to differentiate to the common section which should be
> applied to all submodules?

It is not about submodule per-se, but what is the right way to use
the parse_config_key() function.  If the caller is interested in
seeing if the name is two-level or three-level, NULL-ness of the
subsection pointer is the right thing to check, not the length of
the subsection (set to 0 or positive number if exists--and otherwise
it is set to 0).

People copy & paste existing uses of API functions, and even if for
the specific use of your code (i.e. submodule) it is illegal to have
an empty second level, we shouldn't leaving a bad practice in the
code to be imitated.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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