Expand description
The git-storage contract: GitOps, the backend-neutral eleven.
This is the contract written into znippy-plugin-git’s store.rs
(“The twelve functions. Nothing else is permitted here.”), lifted out so it
is no longer owned by one implementation. It defines what a git object+ref
store must be able to do, and names no storage, no index, no durability
mechanism and no codec — so both backends implement the same trait:
| implementer | where | how it stores |
|---|---|---|
znippy-plugin-git | plugins/native/znippy-plugin-git (this repo) | Arrow-IPC in a znippy archive (OpenZL) |
storage-git-gix | edda/crates/storage-git-gix | gix-odb / gix-ref on a filesystem |
§Why this crate is tiny, and must stay that way
It depends on anyhow and nothing else. That is load-bearing: the gix
backend must be able to implement this contract without linking Arrow or
OpenZL’s C++ toolchain, and the znippy backend must not have to link gix.
A dependency added here is a dependency forced on both.
§“Eleven”, not “twelve” — where seal() went
The original GitOps in znippy had a twelfth method, seal() -> Vec<ReservedSection>, that folds the live logs into the reserved Arrow
sections a znippy archive carries. ReservedSection is an Arrow type
(RecordBatch payloads); a gix backend has no such sections and no analog.
So seal() is an implementation detail of the znippy backend, not part of
the neutral contract — it stays an inherent method on GitStore, which is
how gunnar already calls it (on the concrete store, never through this
trait). Keeping it here would have forced Arrow onto the gix backend for a
method it can never implement.
Structs§
- Caps
- What the client said it can parse, as far as pack emission is concerned.
- GcReport
- What one GC run did. Every field is measured off the store after the fact — nothing here is an input echoed back.
- OidList
- Many raw oids in ONE allocation.
- Pack
Stats - The receipt for one
GitServe::emit_pack. - Reach
Set - One
GitServe::selectanswer. - RefCas
- One ref edit with the value the caller expects to find.
- RefRow
- One row of the ref namespace: name, oid, peeled.
- RefUpdate
- One ref update in a push.
- Stored
- What
gethands back: the stored bytes and enough type information that they cannot be mistaken for something else. - TxId
- The receipt for one durable transaction.
Enums§
- ObjType
- The type of a stored object, as it appears in the pack — so it may be a
delta (
OfsDelta/RefDelta) rather than a resolved type. - Observed
- What was actually there — including the case where something was there and could not be decoded.
- RefRejection
- Why a ref write was refused, typed.
- RefTarget
- One ref target, backend-neutrally: an object, or another ref.
Traits§
- GitOps
- The eleven. Typed, backend-neutral, and the only entry point a git server needs into storage.
- GitServe
- The READING contract.