Skip to content
zit Artifact [a11ec15e37]
Login

Artifact [a11ec15e37]

Artifact a11ec15e37228a9fd162dafeff8958a3dbed52e95b3fcf1ce34e16ee38ed765e:


zit

A Fossil version-control system in Zig.

zit reads and writes Fossil's artifacts and speaks Fossil's sync protocol, so it clones from, pushes to, pulls from, and serves stock fossil, and a checkout means the same thing to both tools. It is written from the specifications, not ported from C: six Internet-Drafts frozen in docs/rfcs/ are the authority, and Fossil itself appears only in the differential tests that hold the two implementations to the same answer.

The zit binary is a thin command over a library — a Zig counterpart to libfossil. No module touches ambient time, randomness, filesystem, or network; effects arrive through injected interfaces, the sync client is a pure state machine, and the whole stack runs under seeded deterministic simulation where any failure replays exactly from its seed.

Download

Release binaries for macOS ARM64 and Linux x86-64/ARM64, with checksums and a source archive, are at fossil.craftdesign.group/zit and mirrored to GitHub releases. See the 0.6.2 release notes for changes and compatibility, and the 0.1.0 notes for the basis of the conformance claim.

What it does

The everyday verbs — init, add, commit, update, merge, diff, status, timeline, branch, tag, annotate, grep, bisect, stash, undo/redo, clone, push, pull, sync, serve — with Fossil's output shapes and Fossil's settings: .fossil-settings/ is read at every tier, and ignore-glob, clean-glob, manifest, and the rest mean what they mean in Fossil. zit help lists everything; any unambiguous prefix of a verb works.

Beyond that:

What it leaves to Fossil

By decision, not omission — zit is a version-control system, not a forge.

The specifications

The drafts are the authority, not Fossil's source. Test expectations come from the spec text and its worked examples — every normative clause a module implements gets a test citing its section. Where Fossil's implemented behaviour and an earlier draft text disagreed, the draft was corrected in place and lists the change in its Changes appendix.

Module Draft What it specifies
delta draft-fossil-delta-format-00 byte-level delta encoding
artifact draft-fossil-artifact-format-00 manifest / control-artifact card format, naming, checksums
repostate draft-fossil-repo-state-00 derived branch / tag / leaf / current-trunk views
submanifest draft-fossil-submanifests-00 S-card tree manifests: bounded per-commit manifest size for wide repositories
sync draft-fossil-sync-protocol-00 HTTP sync / clone protocol
cone draft-fossil-sparse-cone-00 sparse cones: partial worktrees, the sparse-store path for monorepos

Build

Requires Zig 0.16 or later.

zig build --release=fast   # the shipped binary, at zig-out/bin/zit
zig-out/bin/zit version
zig build test             # unit tests, one cited test per RFC clause

--release=fast is what the release builds use; a plain zig build is a Debug binary, many times slower on a real history.

Further steps: zig build e2e (spawns the real binary), smoke (interop against a fossil on PATH), muscle (differential transcript against fossil), git-import-e2e / git-export-e2e (against a real git), dst (deterministic simulation; -- --seed N replays), fuzz -- <target> --seed N, bench, and cov (kcov line coverage). zig build --help lists them all.

Source control

This project is itself under Fossil. The repository lives in .zit.fossil (ignored); open a checkout with fossil open --keep .zit.fossil. Trunk is mirrored to GitHub, where issues and CI live.