Skip to main content

Module format

Module format 

Source
Expand description

Human-oriented output formatters — the CLI’s thin presentation layer. Anything that emits canonical on-disk or wire bytes belongs in mkit-core (serialize.rs, pack.rs, etc.), not here.

Structs§

JsonObject
A minimal single-object JSON builder for --format=json on the mutating commands (commit, push, pull, fetch, merge, cherry-pick, revert, rebase, stash, tag, verify-attest): each invocation emits exactly one JSON object to stdout describing the outcome, unlike log/branch’s per-record JSONL streaming.

Constants§

SUMMARY_ABBREV
Default abbreviation length for the git-style ref-update summary lines (<old7>..<new7>). Matches log --oneline’s default; mkit ids stay BLAKE3 prefixes (the documented hash-length divergence).

Functions§

full_identity
Full-detail rendering of an mkit_core::Identity suitable for machine-readable output (e.g. JSONL from mkit log --format=json).
hex_hash
Render a Hash as 64 lowercase hex chars. Wrapper over mkit_core’s byte-level API that keeps a stable name at this layer.
human_date_utc
Render a Unix timestamp (seconds since the epoch, UTC) as a stable, human-readable string: YYYY-MM-DD HH:MM:SS +0000.
json_escape
Escape a Rust string for inclusion in a JSON string literal. Sufficient for the small, known fields emitted by --format=json callers (commit messages, hashes, identity strings). Does NOT handle surrogate pairs — UTF-8 round-trips as itself since JSON strings are UTF-8.
json_string_array
Render a slice of strings as a JSON array of escaped string literals, e.g. for a field_raw value: ["a","b"].
ref_rejected_line
The git-style rejected-ref summary line (non-fast-forward), printed alongside the actionable hint when a push is refused.
ref_update_line
A single git-style ref-update summary line, as printed under the To <url> / From <url> header of a push or fetch. old is the previous value of the destination ref (None = the ref did not exist), new the value just written; src -> dst is the refspec mapping.
short_hash
Render the first n hex chars of a hash (min 4, max 64).
short_identity
Render a short mkit_core::Identity: for 8-byte opaque keys we show the LE u64 decimal; otherwise <kind>:<8-hex>.