From 73e602a5c2c766caba59948e91c11122653705ec Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 10 Mar 2026 13:30:48 +0800 Subject: commitgraph: Move out of format/ --- commitgraph/constants.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 commitgraph/constants.go (limited to 'commitgraph/constants.go') diff --git a/commitgraph/constants.go b/commitgraph/constants.go new file mode 100644 index 00000000..3a06a290 --- /dev/null +++ b/commitgraph/constants.go @@ -0,0 +1,32 @@ +package commitgraph + +const ( + FileSignature = 0x43475048 // "CGPH" + FileVersion = 1 +) + +const ( + ChunkOIDF = 0x4f494446 // "OIDF" + ChunkOIDL = 0x4f49444c // "OIDL" + ChunkCDAT = 0x43444154 // "CDAT" + ChunkGDA2 = 0x47444132 // "GDA2" + ChunkGDO2 = 0x47444f32 // "GDO2" + ChunkEDGE = 0x45444745 // "EDGE" + ChunkBIDX = 0x42494458 // "BIDX" + ChunkBDAT = 0x42444154 // "BDAT" + ChunkBASE = 0x42415345 // "BASE" +) + +const ( + HeaderSize = 8 + ChunkEntrySize = 12 + FanoutSize = 256 * 4 +) + +const ( + ParentNone = 0x70000000 + ParentExtraMask = 0x80000000 + ParentLastMask = 0x7fffffff + + GenerationOverflow = 0x80000000 +) -- cgit v1.3.1-10-gc9f91