From: Junio C Hamano Date: Wed, 08 Aug 2012 17:05:28 GMT Subject: Re: [PATCH/RFC v3 06/13] Read index-v5 Message-ID: <7vipcttiuf.fsf@alter.siamese.dyndns.org> In-Reply-To: Nguyen Thai Ngoc Duy writes: >> +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?