Re: [PATCH/RFC v3 06/13] Read index-v5
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 8, 2012, 17:05 UTC
- Message-ID
- <7vipcttiuf.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CACsJy8DZ-+0XD2HxkTFuXKXJFH66MCLLrfHtcMF-1GqBb2AmVg@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 12 quoted lines
>> +struct index_ops v5_ops = {
>> + match_stat_basic,
>> + verify_hdr,
>> + read_index_v5,
>> + NULL
>> +};
>
> If you do it right, putting write_index_v2 here should work because
> in-core structure is not changed (except that write_index_v2 is static
> function, well..). Maybe putting write_index to this struct is a wrong
> decision. We should be able to read_index_v5+write_index_v2 and
> read_index_v2+write_index_v5.The "right way" is to have a global API function
write_index_in_format(int version, int fd);
which calls "the_index->index_ops.write_index[version](the_index, fd)", no?