summaryrefslogtreecommitdiff
path: root/t/unit-tests/u-hashmap.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2025-10-09 21:56:18 +0000
committerJunio C Hamano <gitster@pobox.com>2025-10-09 17:46:13 -0700
commit87264b7dde2be9e555243f0dce649b785407827e (patch)
treec1e5698c033753953a250dd13f11890e97020e8e /t/unit-tests/u-hashmap.c
parentc44beea485f0f2feaf460e2ac87fdd5608d63cf0 (diff)
docs: update pack index v3 format
Our current pack index v3 format uses 4-byte integers to find the trailer of the file. This effectively means that the file cannot be much larger than 2^32. While this might at first seem to be okay, we expect that each object will have at least 64 bytes worth of data, which means that no more than about 67 million objects can be stored. Again, this might seem fine, but unfortunately, we know of many users who attempt to create repos with extremely large numbers of commits to get a "high score," and we've already seen repositories with at least 55 million commits. In the interests of gracefully handling repositories even for these well-intentioned but ultimately misguided users, let's change these lengths to 8 bytes. For the checksums at the end of the file, we're producing 32-byte SHA-256 checksums because that's what we already do with pack index v2 and SHA-256. Truncating SHA-256 doesn't pose any actual security problems other than those related to the reduced size, but our pack checksum must already be 32 bytes (since SHA-256 packs have 32-byte checksums) and it simplifies the code to use the existing hashfile logic for these cases for the index checksum as well. In addition, even though we may not need cryptographic security for the index checksum, we'd like to avoid arguments from auditors and such for organizations that may have compliance or security requirements. Using the simple, boring choice of the full SHA-256 hash avoids all possible discussion related to hash truncation and removes impediments for these organizations. Note that we do not yet have a pack index v3 implementation in Git, so it should be fine to change this format. However, such an implementation has been written for future inclusion following this format. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/u-hashmap.c')
0 files changed, 0 insertions, 0 deletions