1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
-
+
-
-
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
|
# zit
Fossil, reimplemented from its specifications, in Zig.
A Fossil version-control system 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.
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
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.
specifications, not ported from C: six Internet-Drafts frozen in this
repository 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 — whose modules take no ambient time, randomness, filesystem, or
network, so the whole stack runs under seeded deterministic simulation.
## Download
[Download Zit 0.3.8 for macOS ARM64 or Linux x86-64/ARM64, or get the source archive](uv/download.html?v=0.3.8), or read the [release notes](doc/version-0.3.8/docs/RELEASE-NOTES-0.3.8.md).
Releases are also mirrored to [GitHub](https://github.com/danmestas/zit/releases).
## 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, `ignore-glob`, `clean-glob`, `manifest`, and the rest mean
what they mean in Fossil.
Beyond that:
* **Git in both directions** — `import-git` and `export-git`.
* **Sub-manifests** — bounded per-commit manifest size for wide
repositories (`submanifest analyze` / `enable`). Off by default; a
repository that turns them on is no longer readable by stock Fossil, and
sync refuses to hand such artifacts to a peer that would misread them.
* **Sparse cones** — partial worktrees (`open --cone`, `cone`).
* **Indexer feeds** — `frames` and `crosslink` stream raw artifacts and
derived per-check-in records from a cursor, for a forge or search index.
* **Store care** — `verify`, `pack`, `purge`, `shun`, and a local rebuild
`checkpoint` that keeps cache-cold opens fast on large histories.
## What it leaves to Fossil
By decision, not omission. The collaboration artifacts — wiki, tickets,
forum, technotes, attachments — are stored and synced by hash but never
interpreted, and the web UI goes with them (`zit ui` hands off to a forge that
serves the repository). There is no unversioned-file
store; a peer's unversioned files are declined visibly. zit never signs a
manifest and never creates a SHA-1 repository, though it reads both.
## 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.
authority. Expected values in tests come from the spec text and its worked
examples, never from observing another implementation; where the code
follows Fossil's implemented behaviour against the published text, the
divergence is recorded in [docs/rfcs/erratum](dir?ci=trunk&name=docs/rfcs/erratum).
| 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 |
| `submanifest` | [draft-fossil-submanifests-00](doc/trunk/docs/rfcs/draft-fossil-submanifests-00.txt) | S-card tree manifests: bounded per-commit manifest size for wide repositories |
| `sync` | [draft-fossil-sync-protocol-00](doc/trunk/docs/rfcs/draft-fossil-sync-protocol-00.txt) | HTTP replication of the artifact set between repositories |
| `cone` | [draft-fossil-sparse-cone-00](doc/trunk/docs/rfcs/draft-fossil-sparse-cone-00.txt) | sparse cones: partial worktrees and the sparse-store path for monorepos |
Each layer depends only on the layers before it:
delta -> artifact -> repostate -> sync
\-> submanifest -/
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
zig build smoke # interop check against a fossil binary on PATH
## 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
* [README](doc/trunk/README.md) — design notes, scope, and build steps
* [Release notes](dir?ci=trunk&name=docs&re=RELEASE-NOTES) — every release, oldest to newest
* [docs/rfcs](dir?ci=trunk&name=docs/rfcs) — the six frozen drafts
* [GitHub mirror](https://github.com/danmestas/zit) — issues and CI
|