Skip to content
zit Artifact [b56a5c6f9c]
Login

Artifact [b56a5c6f9c]

Artifact b56a5c6f9c062542cb77586fff471e32602260ad9129f1471d09ca37088234a5:


# zit

A [Fossil](https://fossil-scm.org) version-control system implemented in
[Zig](https://ziglang.org) — a direct port of the Fossil formats and protocol
from their specifications.

zit is driven by four companion Internet-Drafts (the frozen reference finals
are in [`docs/rfcs/`](docs/rfcs/)):

| Module | RFC | 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 |
| `sync` | `draft-fossil-sync-protocol-00` | HTTP sync / clone protocol |

Implementation follows the RFC dependency layering:

```
delta  ->  artifact  ->  repostate  ->  sync
```

## Scope

zit targets the **version-control substrate**: the check-in (manifest),
cluster, and tag/control artifact types. The collaboration types (wiki,
ticket, forum, attachment, technote) are carried opaquely — stored and
transported by hash, but not interpreted.

## Build

Requires Zig 0.16+.

```sh
zig build            # build the `zit` binary into zig-out/bin/
zig build run -- version
zig build test       # run unit tests
```

## Status

Scaffold. Implemented so far:

- `delta`: base-64 integer codec (MSB-first) and the checksum (mod 2³²),
  each with RFC-derived test vectors.
- `artifact`: artifact naming (SHA-1 / SHA3-256, lowercase hex) and the
  Z-card MD5, with the RFC's own example vectors as tests.

Everything else is stubbed against its RFC section. Work proceeds test-first,
one RFC rule at a time, verifying against the reference implementation
(fossil 2.28) where a byte-exact check is possible.

## Source control

This project is itself under Fossil. The repository lives in `.zit.fossil`
(ignored); open a checkout with `fossil open --keep .zit.fossil`.