Re: [PATCH v1 05/19] update-index: warn in case of split-index incoherency
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 1, 2016, 19:05 UTC
- Message-ID
- <xmqqlgx3owbg.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CACsJy8Br2q0aadTFjkNgb=oN8nSzbkWJEK7bCCgr7v-oOZtrSA@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 14 quoted lines
>> diff --git a/builtin/update-index.c b/builtin/update-index.c
>> index b75ea03..a14dbf2 100644
>> --- a/builtin/update-index.c
>> +++ b/builtin/update-index.c
>> @@ -1098,12 +1098,21 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
>> }
>>
>> if (split_index > 0) {
>> + if (git_config_get_split_index() == 0)
>> + warning("core.splitIndex is set to false; "
>> + "remove or change it, if you really want to "
>> + "enable split index");
>
> Wrap this string and the one below with _() so they can be translated.True.
I further wonder if a natural reaction from users after seeing this message is "I do want to--what else would I use that option to run you for? Just do as you are told, instead of telling me what to do!". Is this warning really a good idea, or shouldn't these places be setting the configuration?
Show 17 quoted lines
>> if (the_index.split_index)
>> the_index.cache_changed |= SPLIT_INDEX_ORDERED;
>> else
>> add_split_index(&the_index);
>> - } else if (!split_index)
>> + } else if (!split_index) {
>> + if (git_config_get_split_index() == 1)
>> + warning("core.splitIndex is set to true; "
>> + "remove or change it, if you really want to "
>> + "disable split index");
>> remove_split_index(&the_index);
>> + }
>>
>> switch (untracked_cache) {
>> case UC_UNSPECIFIED:
>> --
>> 2.10.1.462.g7e1e03a