Re: [PATCH 10/23] midx: write a lookup into the pack names chunk
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Jun 21, 2018, 17:23 UTC
- Message-ID
- <72b3e833-0071-ee94-b91e-c558af4927a0@gmail.com>
- In-Reply-To
- <CACsJy8C0K_3-=S-sV+jfKdRoF0Ta8eafbOT_B1zOfWCftwz8Bw@mail.gmail.com>
On 6/9/2018 12:43 PM, Duy Nguyen wrote:
Show 28 quoted lines
> On Thu, Jun 7, 2018 at 7:01 PM Derrick Stolee <stolee@gmail.com> wrote:
>> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
>> ---
>> Documentation/technical/pack-format.txt | 5 +++
>> builtin/midx.c | 7 ++++
>> midx.c | 56 +++++++++++++++++++++++--
>> object-store.h | 2 +
>> t/t5319-midx.sh | 11 +++--
>> 5 files changed, 75 insertions(+), 6 deletions(-)
>>
>> diff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt
>> index 2b37be7b33..29bf87283a 100644
>> --- a/Documentation/technical/pack-format.txt
>> +++ b/Documentation/technical/pack-format.txt
>> @@ -296,6 +296,11 @@ CHUNK LOOKUP:
>>
>> CHUNK DATA:
>>
>> + Packfile Name Lookup (ID: {'P', 'L', 'O', 'O'}) (P * 4 bytes)
>> + P * 4 bytes storing the offset in the packfile name chunk for
>> + the null-terminated string containing the filename for the
>> + ith packfile.
>> +
> Commit message is too light on this one. Why does this need to be
> stored? Isn't the cost of rebuilding this in-core cheap?
>
> Adding this chunk on disk in my opinion only adds more burden. Now you
> have to verify that these offsets actually point to the right place.This is a very good point. I'll drop the chunk and just read the names directly to construct the array of strings.
Thanks, -Stolee