Expand description
__gunnar_refs__ — the ref namespace as an append-only Arrow push log.
One RecordBatch per push, written through crate::pushlog. A push that
updates three branches is three rows in one batch, and those three either all
land or none do, because the frame either completes or it does not. That is
the whole transaction mechanism — there is no lock file, no journal and (D18)
no database.
§Columns
| column | meaning |
|---|---|
name | full ref name, e.g. refs/heads/main |
target | the oid it now points at; null means the ref was deleted |
peeled | for an annotated tag, the commit it peels to |
symref_target | for a symbolic ref (HEAD → refs/heads/main), its target |
push_seq | monotonic push counter — the ordering authority |
updated_ms | wall clock, unix ms; for humans, never for ordering |
updated_ms is deliberately not the ordering key: two pushes inside the same
millisecond, or a clock that steps backwards, would silently reorder the ref
namespace. push_seq is assigned by the writer and is the only thing
fold compares.
§Current state
The log is the history; fold replays it into the current namespace, last
writer wins by push_seq, and a null target removes the ref. Reading the
current refs is therefore a scan of a structure sized by pushes, not by
repository size.
Structs§
- RefLog
- The ref log of one repository.
- RefState
- The state of one ref after replaying the log.
- RefUpdate
- One ref update inside a push. Owned by the
git-storage-traitcontract; re-exported here socrate::refs::RefUpdatestays a valid path. One ref update in a push.
Functions§
- build_
push_ batch - Build the single
RecordBatchthat is one push. - fold
- Replay pushes into the current namespace. Last writer wins by
push_seq; a nulltargetand nosymref_targetdeletes the ref. - read_
refs - Read the sealed
__gunnar_refs__section out of an archive.Ok(None)when the archive carries none — distinct from an archive whose refs are empty. - refs_
schema