Re: [PATCH v6 3/7] eoie: add End of Index Entry (EOIE) extension

2018-09-29 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Sep 26, 2018 at 03:54:38PM -0400, Ben Peart wrote: >> + >> +#define EOIE_SIZE (4 + GIT_SHA1_RAWSZ) /* <4-byte offset> + <20-byte hash> >> */ >> +#define EOIE_SIZE_WITH_HEADER (4 + 4 + EOIE_SIZE) /* <4-byte signature> + >> <4-byte length> + EOIE_SIZE */ > > If you ma

Re: [PATCH v6 3/7] eoie: add End of Index Entry (EOIE) extension

2018-09-28 Thread Duy Nguyen
On Wed, Sep 26, 2018 at 03:54:38PM -0400, Ben Peart wrote: > + > +#define EOIE_SIZE (4 + GIT_SHA1_RAWSZ) /* <4-byte offset> + <20-byte hash> */ > +#define EOIE_SIZE_WITH_HEADER (4 + 4 + EOIE_SIZE) /* <4-byte signature> + > <4-byte length> + EOIE_SIZE */ If you make these variables instead of macr

Re: [PATCH v6 3/7] eoie: add End of Index Entry (EOIE) extension

2018-09-28 Thread SZEDER Gábor
On Wed, Sep 26, 2018 at 03:54:38PM -0400, Ben Peart wrote: > diff --git a/read-cache.c b/read-cache.c > index 6ba99e2c96..80255d3088 100644 > --- a/read-cache.c > +++ b/read-cache.c > +static size_t read_eoie_extension(const char *mmap, size_t mmap_size) > +{ <> > + the_hash_algo->final_

Re: [PATCH v6 3/7] eoie: add End of Index Entry (EOIE) extension

2018-09-28 Thread Ben Peart
On 9/27/2018 8:19 PM, SZEDER Gábor wrote: On Wed, Sep 26, 2018 at 03:54:38PM -0400, Ben Peart wrote: The End of Index Entry (EOIE) is used to locate the end of the variable Nit: perhaps start with: The End of Index Entry (EOIE) optional extension can be used to ... to make it clearer f

Re: [PATCH v6 3/7] eoie: add End of Index Entry (EOIE) extension

2018-09-27 Thread SZEDER Gábor
On Wed, Sep 26, 2018 at 03:54:38PM -0400, Ben Peart wrote: > The End of Index Entry (EOIE) is used to locate the end of the variable Nit: perhaps start with: The End of Index Entry (EOIE) optional extension can be used to ... to make it clearer for those who don't immediately realize the sign

[PATCH v6 3/7] eoie: add End of Index Entry (EOIE) extension

2018-09-26 Thread Ben Peart
The End of Index Entry (EOIE) is used to locate the end of the variable length index entries and the beginning of the extensions. Code can take advantage of this to quickly locate the index extensions without having to parse through all of the index entries. Because it must be able to be loaded be