Re: [PATCH v6 08/10] submodule: add a helper to check if it is safe to write to .gitmodules
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 6, 2018, 23:44 UTC
- Message-ID
- <xmqq36tiwsh7.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAGZ79kbaeRVBLhYiqzisADHs+Af+c2giXcsCySAEe4jue_rWwA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 8 quoted lines
>> static int module_config(int argc, const char **argv, const char *prefix)
>> {
>> + enum {
>> + CHECK_WRITEABLE = 1
>> + } command = 0;
>
> Can we have the default named? Then we would only use states
> from within the enum?Why? Do we use a half-intelligent "switch () { case ...: ... }" checker that would otherwise complain if we handled "case 0" in such a switch statement, or something like that?
Are we going to gain a lot more enum members, by the way? At this point, this looks more like a
unsigned check_writable = 0; /* default is not to check */
to me.