Git development
 help / color / mirror / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Derrick Stolee" <stolee@gmail.com>,
	"Torsten Bögershausen" <tboegi@web.de>,
	"Jeff King" <peff@peff.net>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>
Subject: [PATCH v2 09/11] test-tool synthesize: add precomputed SHA-256 pack for 4 GiB + 1
Date: Mon, 04 May 2026 17:08:26 +0000	[thread overview]
Message-ID: <8e6e7208040917a254379fd6c63d432f5e2f6f59.1777914508.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2102.v2.git.1777914508.gitgitgadget@gmail.com>

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Add a SHA-256 entry to the fast_packs[] table. The pack prefix and
deflate block structure are identical to SHA-1 (the pack format does
not encode the hash algorithm in its header). Only the suffix differs:
SHA-256 OIDs are 32 bytes instead of 20, giving a 609-byte suffix
compared to 513 for SHA-1, and a different pack checksum.

The constants were generated by running the generic path inside a
repository initialized with --object-format=sha256.

Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/helper/test-synthesize.c | 91 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/t/helper/test-synthesize.c b/t/helper/test-synthesize.c
index 83c40ee02a..1f28ecf0f2 100644
--- a/t/helper/test-synthesize.c
+++ b/t/helper/test-synthesize.c
@@ -246,6 +246,90 @@ static const unsigned char fast_pack_sha1_suffix[] = {
 	0xe3
 };
 
+/*
+ * SHA-256 suffix: same structure, but with 32-byte OIDs and SHA-256
+ * pack checksum (609 bytes vs 513 for SHA-1).
+ */
+static const unsigned char fast_pack_sha256_suffix[] = {
+	0xac, 0x02, 0x78, 0x01, 0x01, 0x2c, 0x00, 0xd3,
+	0xff, 0x31, 0x30, 0x30, 0x36, 0x34, 0x34, 0x20,
+	0x66, 0x69, 0x6c, 0x65, 0x00, 0x42, 0x53, 0xc1,
+	0x8a, 0x9f, 0x5e, 0xc3, 0xbb, 0x47, 0xb0, 0x83,
+	0x8a, 0x19, 0xdb, 0x31, 0xbb, 0x7b, 0x0f, 0x3b,
+	0x80, 0xa4, 0xbc, 0x2f, 0xaf, 0x72, 0x6b, 0xdb,
+	0x62, 0xaa, 0xba, 0xdd, 0xde, 0x77, 0xc6, 0x13,
+	0xeb, 0x9d, 0x0c, 0x78, 0x01, 0x01, 0xcd, 0x00,
+	0x32, 0xff, 0x74, 0x72, 0x65, 0x65, 0x20, 0x62,
+	0x36, 0x30, 0x39, 0x37, 0x37, 0x64, 0x37, 0x63,
+	0x34, 0x63, 0x32, 0x64, 0x31, 0x65, 0x63, 0x63,
+	0x33, 0x66, 0x62, 0x61, 0x31, 0x64, 0x39, 0x38,
+	0x65, 0x65, 0x31, 0x32, 0x30, 0x61, 0x64, 0x63,
+	0x32, 0x34, 0x38, 0x33, 0x34, 0x39, 0x35, 0x30,
+	0x62, 0x65, 0x34, 0x31, 0x32, 0x64, 0x39, 0x34,
+	0x63, 0x38, 0x30, 0x39, 0x34, 0x38, 0x30, 0x66,
+	0x35, 0x38, 0x62, 0x61, 0x39, 0x64, 0x61, 0x0a,
+	0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x20, 0x41,
+	0x20, 0x55, 0x20, 0x54, 0x68, 0x6f, 0x72, 0x20,
+	0x3c, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x40,
+	0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
+	0x63, 0x6f, 0x6d, 0x3e, 0x20, 0x31, 0x32, 0x33,
+	0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x20,
+	0x2b, 0x30, 0x30, 0x30, 0x30, 0x0a, 0x63, 0x6f,
+	0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x20,
+	0x43, 0x20, 0x4f, 0x20, 0x4d, 0x69, 0x74, 0x74,
+	0x65, 0x72, 0x20, 0x3c, 0x63, 0x6f, 0x6d, 0x6d,
+	0x69, 0x74, 0x74, 0x65, 0x72, 0x40, 0x65, 0x78,
+	0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
+	0x6d, 0x3e, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35,
+	0x36, 0x37, 0x38, 0x39, 0x30, 0x20, 0x2b, 0x30,
+	0x30, 0x30, 0x30, 0x0a, 0x0a, 0x4c, 0x61, 0x72,
+	0x67, 0x65, 0x20, 0x62, 0x6c, 0x6f, 0x62, 0x20,
+	0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x0a, 0xb7,
+	0x80, 0x3d, 0xd7, 0x20, 0x78, 0x01, 0x01, 0x00,
+	0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x95,
+	0x11, 0x78, 0x01, 0x01, 0x15, 0x01, 0xea, 0xfe,
+	0x74, 0x72, 0x65, 0x65, 0x20, 0x36, 0x65, 0x66,
+	0x31, 0x39, 0x62, 0x34, 0x31, 0x32, 0x32, 0x35,
+	0x63, 0x35, 0x33, 0x36, 0x39, 0x66, 0x31, 0x63,
+	0x31, 0x30, 0x34, 0x64, 0x34, 0x35, 0x64, 0x38,
+	0x64, 0x38, 0x35, 0x65, 0x66, 0x61, 0x39, 0x62,
+	0x30, 0x35, 0x37, 0x62, 0x35, 0x33, 0x62, 0x31,
+	0x34, 0x62, 0x34, 0x62, 0x39, 0x62, 0x39, 0x33,
+	0x39, 0x64, 0x64, 0x37, 0x34, 0x64, 0x65, 0x63,
+	0x63, 0x35, 0x33, 0x32, 0x31, 0x0a, 0x70, 0x61,
+	0x72, 0x65, 0x6e, 0x74, 0x20, 0x37, 0x35, 0x62,
+	0x66, 0x30, 0x63, 0x34, 0x37, 0x61, 0x65, 0x34,
+	0x62, 0x62, 0x33, 0x30, 0x38, 0x65, 0x37, 0x63,
+	0x63, 0x32, 0x34, 0x38, 0x32, 0x65, 0x32, 0x32,
+	0x65, 0x66, 0x61, 0x65, 0x33, 0x37, 0x38, 0x37,
+	0x61, 0x39, 0x36, 0x38, 0x34, 0x38, 0x62, 0x64,
+	0x31, 0x37, 0x34, 0x39, 0x35, 0x36, 0x37, 0x31,
+	0x34, 0x37, 0x31, 0x35, 0x32, 0x34, 0x36, 0x64,
+	0x64, 0x62, 0x64, 0x35, 0x34, 0x0a, 0x61, 0x75,
+	0x74, 0x68, 0x6f, 0x72, 0x20, 0x41, 0x20, 0x55,
+	0x20, 0x54, 0x68, 0x6f, 0x72, 0x20, 0x3c, 0x61,
+	0x75, 0x74, 0x68, 0x6f, 0x72, 0x40, 0x65, 0x78,
+	0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
+	0x6d, 0x3e, 0x20, 0x31, 0x32, 0x33, 0x34, 0x35,
+	0x36, 0x37, 0x38, 0x39, 0x30, 0x20, 0x2b, 0x30,
+	0x30, 0x30, 0x30, 0x0a, 0x63, 0x6f, 0x6d, 0x6d,
+	0x69, 0x74, 0x74, 0x65, 0x72, 0x20, 0x43, 0x20,
+	0x4f, 0x20, 0x4d, 0x69, 0x74, 0x74, 0x65, 0x72,
+	0x20, 0x3c, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
+	0x74, 0x65, 0x72, 0x40, 0x65, 0x78, 0x61, 0x6d,
+	0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x3e,
+	0x20, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+	0x38, 0x39, 0x30, 0x20, 0x2b, 0x30, 0x30, 0x30,
+	0x30, 0x0a, 0x0a, 0x45, 0x6d, 0x70, 0x74, 0x79,
+	0x20, 0x74, 0x72, 0x65, 0x65, 0x20, 0x63, 0x6f,
+	0x6d, 0x6d, 0x69, 0x74, 0x0a, 0x6d, 0x6d, 0x51,
+	0x9a, 0xc9, 0x11, 0x76, 0x61, 0xa3, 0x89, 0x49,
+	0xb7, 0xa1, 0x58, 0xc6, 0x1d, 0x8c, 0x33, 0x75,
+	0x8d, 0x7e, 0x4d, 0x8e, 0x58, 0x91, 0xf8, 0x5c,
+	0x57, 0xd9, 0x89, 0x9e, 0xb8, 0xd2, 0x9a, 0xd8,
+	0xc9
+};
+
 static const struct fast_pack fast_packs[] = {
 	{
 		.format_id = GIT_SHA1_FORMAT_ID,
@@ -253,6 +337,13 @@ static const struct fast_pack fast_packs[] = {
 		.suffix_len = sizeof(fast_pack_sha1_suffix),
 		.commit_oid = "aac43daf40d0377af31aa9c798a4ae8a31b55c1d",
 	},
+	{
+		.format_id = GIT_SHA256_FORMAT_ID,
+		.suffix = fast_pack_sha256_suffix,
+		.suffix_len = sizeof(fast_pack_sha256_suffix),
+		.commit_oid = "63c46ca51267b1d45be69a044bb84b4bf0559f09"
+			      "d727f861d2ae94ddebdddbc9",
+	},
 };
 
 /*
-- 
gitgitgadget


  parent reply	other threads:[~2026-05-04 17:08 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 16:26 [PATCH 0/6] Handle cloning of objects larger than 4GB on Windows Johannes Schindelin via GitGitGadget
2026-04-28 16:26 ` [PATCH 1/6] index-pack, unpack-objects: use size_t for object size Johannes Schindelin via GitGitGadget
2026-04-30 14:13   ` Torsten Bögershausen
2026-05-03 14:46     ` Johannes Schindelin
2026-04-28 16:26 ` [PATCH 2/6] git-zlib: handle data streams larger than 4GB Johannes Schindelin via GitGitGadget
2026-04-28 16:26 ` [PATCH 3/6] odb, packfile: use size_t for streaming object sizes Johannes Schindelin via GitGitGadget
2026-04-28 16:26 ` [PATCH 4/6] delta, packfile: use size_t for delta header sizes Johannes Schindelin via GitGitGadget
2026-04-29 13:28   ` Derrick Stolee
2026-05-03 14:49     ` Johannes Schindelin
2026-04-28 16:26 ` [PATCH 5/6] test-tool: add a helper to synthesize large packfiles Johannes Schindelin via GitGitGadget
2026-04-28 16:26 ` [PATCH 6/6] t5608: add regression test for >4GB object clone Johannes Schindelin via GitGitGadget
2026-04-29 13:34   ` Derrick Stolee
2026-05-01  6:38     ` Jeff King
2026-05-01 13:19       ` Derrick Stolee
2026-05-04 17:07         ` Johannes Schindelin
2026-04-29 13:35 ` [PATCH 0/6] Handle cloning of objects larger than 4GB on Windows Derrick Stolee
2026-05-04 17:08 ` [PATCH v2 00/11] " Johannes Schindelin via GitGitGadget
2026-05-04 17:08   ` [PATCH v2 01/11] index-pack, unpack-objects: use size_t for object size Johannes Schindelin via GitGitGadget
2026-05-05 19:11     ` Torsten Bögershausen
2026-05-08  7:36       ` Johannes Schindelin
2026-05-08 19:09         ` Torsten Bögershausen
2026-05-10  2:41           ` Junio C Hamano
2026-05-10  9:14             ` Torsten Bögershausen
2026-05-04 17:08   ` [PATCH v2 02/11] git-zlib: handle data streams larger than 4GB Johannes Schindelin via GitGitGadget
2026-05-04 17:08   ` [PATCH v2 03/11] odb, packfile: use size_t for streaming object sizes Johannes Schindelin via GitGitGadget
2026-05-05 19:27     ` Torsten Bögershausen
2026-05-08  7:38       ` Johannes Schindelin
2026-05-04 17:08   ` [PATCH v2 04/11] delta, packfile: use size_t for delta header sizes Johannes Schindelin via GitGitGadget
2026-05-04 17:08   ` [PATCH v2 05/11] test-tool: add a helper to synthesize large packfiles Johannes Schindelin via GitGitGadget
2026-05-04 17:08   ` [PATCH v2 06/11] t5608: add regression test for >4GB object clone Johannes Schindelin via GitGitGadget
2026-05-04 17:08   ` [PATCH v2 07/11] test-tool synthesize: use the unsafe hash for speed Johannes Schindelin via GitGitGadget
2026-05-04 17:08   ` [PATCH v2 08/11] test-tool synthesize: precompute pack for 4 GiB + 1 Johannes Schindelin via GitGitGadget
2026-05-04 18:27     ` Derrick Stolee
2026-05-05 20:54       ` Johannes Schindelin
2026-05-04 17:08   ` Johannes Schindelin via GitGitGadget [this message]
2026-05-04 17:08   ` [PATCH v2 10/11] t5608: mark >4GB tests as EXPENSIVE Johannes Schindelin via GitGitGadget
2026-05-04 17:08   ` [PATCH v2 11/11] ci: run expensive tests on push builds to integration branches Johannes Schindelin via GitGitGadget
2026-05-04 18:35     ` Derrick Stolee
2026-05-05 12:56       ` Junio C Hamano
2026-05-05 23:07         ` Junio C Hamano
2026-05-06  8:33           ` Johannes Schindelin
2026-05-07  9:18             ` Junio C Hamano
2026-05-07 10:24               ` Patrick Steinhardt
2026-05-08  2:50         ` Junio C Hamano
2026-05-08  8:16   ` [PATCH v3 00/11] Handle cloning of objects larger than 4GB on Windows Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 01/11] index-pack, unpack-objects: use size_t for object size Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 02/11] git-zlib: handle data streams larger than 4GB Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 03/11] odb, packfile: use size_t for streaming object sizes Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 04/11] delta, packfile: use size_t for delta header sizes Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 05/11] test-tool: add a helper to synthesize large packfiles Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 06/11] t5608: add regression test for >4GB object clone Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 07/11] test-tool synthesize: use the unsafe hash for speed Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 08/11] test-tool synthesize: precompute pack for 4 GiB + 1 Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 09/11] test-tool synthesize: add precomputed SHA-256 " Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 10/11] t5608: mark >4GB tests as EXPENSIVE Johannes Schindelin via GitGitGadget
2026-05-08  8:16     ` [PATCH v3 11/11] ci: run expensive tests on push builds to integration branches Johannes Schindelin via GitGitGadget
2026-05-10 23:51       ` [PATCH] ci: enable EXPENSIVE for contributor builds Junio C Hamano
2026-05-11  7:05         ` Patrick Steinhardt
2026-05-11  8:29           ` Junio C Hamano
2026-05-11 10:02             ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e6e7208040917a254379fd6c63d432f5e2f6f59.1777914508.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    --cc=stolee@gmail.com \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox