pub struct ExportStats {
pub states_exported: usize,
pub commits_total: usize,
pub threads_synced: usize,
pub markers_synced: usize,
pub branches: Vec<ExportedRef>,
pub tags: Vec<ExportedRef>,
pub failed_refs: Vec<(String, FailedRefExportReason)>,
}Expand description
Statistics for export operation.
commits_total counts the commits that actually land in the
destination: it is derived from the same branch/tag ref set
(collect_ref_updates) that copy_mirror_to_path copies, by walking
the commit ancestry of those tips. Counting from the copy path — rather
than a parallel walk over current Heddle refs — guarantees the reported
total equals what’s copied, including a stale mirror ref left behind by
a dropped thread (export does not prune mirror refs, so that commit
still travels and is still counted). states_exported is the
freshly-minted subset of that same copied ref set — both counts are
partitions of one walk, so states_exported + already == commits_total
holds by construction and a state minted into the mirror but reachable
from no copied ref (an orphan dropped-thread history) inflates neither.
They diverge whenever the destination is already populated: an overlay
re-export reports commits_total = N and states_exported = 0 — the
signal that surfaces “already in sync” instead of a misleading bare
“exported 0 states” (heddle#289, mirroring the import-side
commits_imported/states_created split from heddle#147).
Fields§
§states_exported: usizeFreshly-minted git commits that land in the destination — the subset of the copied ref set’s commits minted during this export (no preserved git_oid). Stays at 0 when every copied commit was already mapped to an existing commit. A minted commit reachable from no copied ref is excluded (it never reaches the destination).
commits_total: usizeUnique commits reachable from the branch/tag tips copied to the
destination, including ones whose commit already existed and any
carried by a stale mirror ref. Mirrors
ImportStats::commits_imported.
threads_synced: usize§markers_synced: usize§branches: Vec<ExportedRef>Branches written to the destination, paired with their tip commit so the summary can show tip short-SHAs.
Tags written to the destination, paired with their tip commit.
failed_refs: Vec<(String, FailedRefExportReason)>Refs this export could NOT publish, paired with why – the fail-soft
counterpart of branches/tags (heddle#261). Export continues past a
failed ref and records it here rather than aborting on the first one,
so a single branch that moved on the Git side cannot mask the outcome
of every ref behind it. Keyed by FULL ref name (refs/heads/foo), the
same spelling the reconcile loops use. Mirrors the import side’s
ImportStats::skipped_non_commit_refs reporting: the operation
succeeds at what it could do and reports the remainder, and the caller
exits non-zero when this is non-empty.