aboutsummaryrefslogtreecommitdiff
path: root/format/commitgraph/constants.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 08:05:51 +0800
committerGravatar Runxi Yu2026-03-06 10:00:35 +0800
commite15054a4f93fc54806e84aa7036e60168e78e823 (patch)
treeb576dcb1d3368324e7ca73ca0fe79dd8865c5524 /format/commitgraph/constants.go
parentinternal/intconv: Add Uint32ToUint8 (diff)
signatureNo signature
format/commitgraph: Add initial commit-graph support
Diffstat (limited to 'format/commitgraph/constants.go')
-rw-r--r--format/commitgraph/constants.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/format/commitgraph/constants.go b/format/commitgraph/constants.go
new file mode 100644
index 00000000..96648fae
--- /dev/null
+++ b/format/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
+)