On Fri, Apr 28, 2017 at 12:17:54AM +0000, brian m. carlson wrote: > > 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