Thread (66 messages) 66 messages, 5 authors, 2017-04-28

Re: [PATCH 35/53] Convert the verify_pack callback to struct object_id

From: Jeff King <hidden>
Date: 2017-04-28 01:15:07

On Fri, Apr 28, 2017 at 12:17:54AM +0000, brian m. carlson wrote:
quoted
What's the gain in converting it here? I know we want to get rid of the
bare "20", but we could switch it out for GIT_SHA1_RAWSZ. I suspect you
prefer in the long run to get rid of even those GIT_SHA1_RAWSZ defines,
though.  Could we define a new struct csumfile_hash, csumfile_cmp, etc
(and arguably change the name of "struct sha1file" and friends).  They'd
be boring wrappers around sha1 now, but I think the endgame will involve
us being able to read multiple versions of packs, with distinct
checksum algorithms.
When I wrote this originally, the GIT_MAX_*SZ patch was in
object-id-part9 and hadn't been merged yet.  And I think your concerns
about this being kinda gross are legitimate.  I'll admit I had some
hesitance about it at first.

So I'll reroll this leaving it as an unsigned char with GIT_MAX_RAWSZ.
I feel confident that we're not going to pick a third, different
algorithm for the pack checksum, so that will get us to the point that
we have a big enough buffer, and we can incrementally improve on it
later by using a different struct if we like.
OK, that seems like a good middle ground. We won't know what the end
result looks like until we get closer to it.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help