Re: [PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function

2017-01-02 Thread Jeff King
On Mon, Jan 02, 2017 at 07:18:58PM +0100, Michael Haggerty wrote: > > Given that this patch only converts one caller, I'd be more inclined to > > just have the caller do its own hashcpy. Like: > > > > diff --git a/sha1_file.c b/sha1_file.c > > index 1173071859..16345688b5 100644 > > --- a/sha1_fi

Re: [PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function

2017-01-02 Thread Michael Haggerty
On 01/02/2017 06:09 PM, Jeff King wrote: > [...] > But I think the thing that gives me the most pause is that the oid > version of the function feels bolted-on. The nth_packed_object_sha1() > function is there specifically to give access to the mmap'd pack-index > data. And at least for now, that o

Re: [PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function

2017-01-02 Thread Jeff King
On Mon, Jan 02, 2017 at 04:30:21PM +0100, Michael Haggerty wrote: > On 01/01/2017 08:18 PM, brian m. carlson wrote: > > There are places in the code where we would like to provide a struct > > object_id *, yet read the hash directly from the pack. Provide an > > nth_packed_object_oid function tha

Re: [PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function

2017-01-02 Thread Michael Haggerty
On 01/01/2017 08:18 PM, brian m. carlson wrote: > There are places in the code where we would like to provide a struct > object_id *, yet read the hash directly from the pack. Provide an > nth_packed_object_oid function that mirrors the nth_packed_object_sha1 > function. > > The required cast is

[PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function

2017-01-01 Thread brian m. carlson
There are places in the code where we would like to provide a struct object_id *, yet read the hash directly from the pack. Provide an nth_packed_object_oid function that mirrors the nth_packed_object_sha1 function. The required cast is questionable, but should be safe on all known platforms. Th