OXYGENHUB
# da58bbbbc4d9 oxygen / README.md
4.3 KiB · Markdown · last changed README: the OxygenFlow badge under the title 1 month ago renderedsource blame history raw
1
# Oxygen
2
3
[![OxygenFlow]https://oxygenhub.io/andymccall/oxygen/flow/badge.svg]https://oxygenhub.io/andymccall/oxygen/flow
4
5
Oxygen (`oxy`) is a distributed, commutative version control system written in Rust for large repositories. See [docs/spec.md]docs/spec.md for the specification, [docs/guide.md]docs/guide.md for a user guide by task, and [docs/protocol.md]docs/protocol.md if you are implementing a client or server.
6
7
It is self-hosting: this directory is an Oxygen repository, and the project's own history is kept with `oxy`, not with Git.
8
9
## What is different
10
11
- **History is a set of changes, not a chain of snapshots.** A change records what it did to identified lines and tree nodes and which earlier changes it depends on. Changes that do not depend on each other commute, so there are no merge commits and rebasing independent work rewrites nothing.
12
- **Conflicts are data.** A conflicted state can be committed, pushed and pulled. Resolving one is an ordinary edit followed by a commit.
13
- **Every change has a stable ID and a content hash.** The ID survives rewrites; the hash makes history tamper-evident.
14
- **Everything is signed.** Composite Ed25519 + ML-DSA-65 signatures on changes and on every bookmark update, verified against a trust policy that lives in the repository.
15
- **Every operation is undoable** through an operation log.
16
- **Large files are chunked** with content-defined chunking into a BLAKE3-addressed store.
17
18
## Status
19
20
Early, but usable for its own development. Implemented: the object model, the change graph with conflict detection and resolution, the working copy (`status`, `commit`, `checkout`, `diff`, `undo`), identities and signatures, remotes over local paths and HTTP(S) with `clone`, `fetch`, `pull`, `push`, the reference server `oxy serve`, the trust policy, and packed storage.
21
22
Not yet: checkpoints for very long histories, history editing (`rebase`, `split`, `edit`), multiple workspaces, garbage collection with retention, and the Thin client profile for constrained machines.
23
24
## Building
25
26
```
27
cargo build --release
28
cargo test --workspace
29
```
30
31
The binary is `target/release/oxy`.
32
33
## Quick start
34
35
```
36
oxy identity create --name "Your Name" --email [email protected]
37
oxy config --user core.sign change      # sign every commit
38
oxy init                                 # in a project directory
39
oxy status
40
oxy commit -m "First change"
41
oxy log                                  # -n 10 for the latest ten, -v for full messages
42
```
43
44
Output uses colour, glyphs, and relative times on a UTF-8 terminal, and
45
falls back to plain ASCII when piped, with `--plain`, or with `NO_COLOR` set.
46
47
Collaborating:
48
49
```
50
oxy serve --root /srv/oxy --bind 0.0.0.0:8890 --tls-cert cert.pem --tls-key key.pem --token SECRET
51
oxy clone https://host:8890/project
52
oxy config remote.origin.token SECRET
53
oxy push
54
oxy pull
55
```
56
57
Trust policy, so a server accepts only changes from keys you have granted:
58
59
```
60
oxy policy init                          # your key becomes the root
61
oxy identity export                      # a contributor sends you this file
62
oxy policy grant alice.identity
63
oxy push                                 # publishes the policy
64
```
65
66
Working alongside Git: `oxy git import <repo> <dest>` converts a Git history, `oxy git fetch <url>`
67
brings new commits of a Git remote into the bookmark, `oxy git push <url>` publishes the bookmark as
68
commits on top of them, and `oxy git export <dir>` writes a plain Git mirror.
69
70
Keys have a lifecycle: `oxy identity rotate` moves to a fresh key pair (the policy follows),
71
`oxy identity renew --expires 365` sets an expiry, `oxy identity delegate add bot.identity`
72
lets another key sign for you, and `oxy identity revoke` retires a key. With several root
73
keys, `oxy policy root add|remove|threshold` and `oxy policy sign` gather the required signatures
74
through proposal files.
75
76
## Layout
77
78
| Path | Contents |
79
|---|---|
80
| `crates/oxy-core` | Library: encoding, hashing, objects, the change graph, storage, identities, policy, protocol, repository operations |
81
| `crates/oxy-server` | Reference HTTP(S) server for the wire protocol |
82
| `src/cli` | The `oxy` command-line interface |
83
| `docs/spec.md` | The specification |
84
| `docs/guide.md` | User guide, organised by task |
85
| `docs/protocol.md` | Wire protocol for other implementers |
86
| `docs/prompt.md` | Shell prompt integration |
87
88
## Licence
89
90
MIT or Apache-2.0, at your option.