Skip to content
zit Artifact [7d3fba9a74]
Login

Artifact [7d3fba9a74]

Artifact 7d3fba9a7425e31936f2d2c48bbf05290095c438c03697c96febd0b557d42078:

Wiki page [Home] by dmestas on 2026-07-23 17:45:04.
D 2026-07-23T17:45:04.436
L Home
N text/x-markdown
P 59fc0d71b8816fb7ad5914d12821b766919bf9ff41d62e7c67d24e68e164dd0c
U dmestas
W 2571
# zit

Fossil, reimplemented from its specifications, in Zig.

zit is a clean-room implementation of the Fossil version-control formats
and sync protocol. The deliverable is a reusable library — a Zig
counterpart to libfossil — with the `zit` command as a thin consumer.
Nothing is ported from C: every rule, byte layout, and rejection
condition is taken from four Internet-Drafts frozen in this repository,
and every test cites the clause it covers.

## Download

[Download Zit 0.1.2 for macOS ARM64 or Linux x86-64/ARM64, or get the source archive](uv/download.html?v=0.1.2).

## The specifications

The drafts under [docs/rfcs](dir?ci=trunk&name=docs/rfcs) are the sole
authority. Expected values in tests come from the spec text and its
worked examples, never from observing another implementation.

| Layer | Draft | Specifies |
|-------|-------|-----------|
| `delta` | [draft-fossil-delta-format-00](doc/trunk/docs/rfcs/draft-fossil-delta-format-00.txt) | byte-level delta encoding: copy/literal segments, base-64 integers, mod-2³² checksum |
| `artifact` | [draft-fossil-artifact-format-00](doc/trunk/docs/rfcs/draft-fossil-artifact-format-00.txt) | card-structured manifests and control artifacts, content addressing (SHA-1 / SHA3-256), checksums |
| `repostate` | [draft-fossil-repo-state-00](doc/trunk/docs/rfcs/draft-fossil-repo-state-00.txt) | branch, tag, and leaf state derived from the append-only artifact set |
| `sync` | [draft-fossil-sync-protocol-00](doc/trunk/docs/rfcs/draft-fossil-sync-protocol-00.txt) | HTTP replication of the artifact set between repositories |

Each layer depends only on the layers before it:

    delta -> artifact -> repostate -> sync

That ordering is also the implementation order, and [src](dir?ci=trunk&name=src)
mirrors it module for module.

## Scope

zit implements the version-control substrate: check-in manifests,
clusters, and tag/control artifacts are parsed and interpreted. The
collaboration artifact types — wiki, ticket, forum, attachment,
technote — are carried opaquely: stored, named, and synchronized by
hash, never interpreted.

## Building

Requires Zig 0.16 or later.

    zig build              # produce zig-out/bin/zit
    zig build run -- version
    zig build test         # unit tests, one cited test per RFC clause

## Finding your way

* [Timeline](timeline) — current activity and history
* [Source tree](dir?ci=trunk) — browse the code at trunk
* [README](doc/trunk/README.md) — checkout and build notes
* [docs/rfcs](dir?ci=trunk&name=docs/rfcs) — the four frozen drafts

Z 3e55718e7330a06a5a799bf4288f75ea