| 1 |
# Oxygen |
| 2 |
|
| 3 |
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. |
| 4 |
|
| 5 |
It is self-hosting: this directory is an Oxygen repository, and the project's own history is kept with `oxy`, not with Git. |
| 6 |
|
| 7 |
## What is different |
| 8 |
|
| 9 |
- **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. |
| 10 |
- **Conflicts are data.** A conflicted state can be committed, pushed and pulled. Resolving one is an ordinary edit followed by a commit. |
| 11 |
- **Every change has a stable ID and a content hash.** The ID survives rewrites; the hash makes history tamper-evident. |
| 12 |
- **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. |
| 13 |
- **Every operation is undoable** through an operation log. |
| 14 |
- **Large files are chunked** with content-defined chunking into a BLAKE3-addressed store. |
| 15 |
|
| 16 |
## Status |
| 17 |
|
| 18 |
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. |
| 19 |
|
| 20 |
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. |
| 21 |
|
| 22 |
## Building |
| 23 |
|
| 24 |
``` |
| 25 |
cargo build --release |
| 26 |
cargo test --workspace |
| 27 |
``` |
| 28 |
|
| 29 |
The binary is `target/release/oxy`. |
| 30 |
|
| 31 |
## Quick start |
| 32 |
|
| 33 |
``` |
| 34 |
oxy identity create --name "Your Name" --email [email protected] |
| 35 |
oxy config --user core.sign change # sign every commit |
| 36 |
oxy init # in a project directory |
| 37 |
oxy status |
| 38 |
oxy commit -m "First change" |
| 39 |
oxy log # -n 10 for the latest ten, -v for full messages |
| 40 |
``` |
| 41 |
|
| 42 |
Output uses colour, glyphs, and relative times on a UTF-8 terminal, and |
| 43 |
falls back to plain ASCII when piped, with `--plain`, or with `NO_COLOR` set. |
| 44 |
|
| 45 |
Collaborating through a hub such as OxygenHub: sign in once, in the |
| 46 |
browser, and every repository on that hub clones, fetches and pushes with it. |
| 47 |
|
| 48 |
``` |
| 49 |
oxy auth login https://oxygenhub.io |
| 50 |
oxy clone https://oxygenhub.io/owner/project |
| 51 |
oxy push |
| 52 |
oxy pull |
| 53 |
``` |
| 54 |
|
| 55 |
Or with your own server: |
| 56 |
|
| 57 |
``` |
| 58 |
oxy serve --root /srv/oxy --bind 0.0.0.0:8890 --tls-cert cert.pem --tls-key key.pem --token SECRET |
| 59 |
echo SECRET | oxy auth login https://host:8890 --with-token |
| 60 |
oxy clone https://host:8890/project |
| 61 |
``` |
| 62 |
|
| 63 |
Trust policy, so a server accepts only changes from keys you have granted: |
| 64 |
|
| 65 |
``` |
| 66 |
oxy policy init # your key becomes the root |
| 67 |
oxy identity export # a contributor sends you this file |
| 68 |
oxy policy grant alice.identity |
| 69 |
oxy push # publishes the policy |
| 70 |
``` |
| 71 |
|
| 72 |
Bookmarks (`oxy bookmark create|switch`, `oxy merge`), submodules (`oxy submodule add|update`), |
| 73 |
partial commits (`oxy commit PATH..`, `oxy commit -i`), `oxy blame`, `oxy bisect`, `oxy squash` and |
| 74 |
`oxy rebase` cover the everyday Git toolbox; see the guide. |
| 75 |
|
| 76 |
Working alongside Git: `oxy git import <repo> <dest>` converts a Git history, `oxy git fetch <url>` |
| 77 |
brings new commits of a Git remote into the bookmark, `oxy git push <url>` publishes the bookmark as |
| 78 |
commits on top of them, and `oxy git export <dir>` writes a plain Git mirror. |
| 79 |
|
| 80 |
Keys have a lifecycle: `oxy identity rotate` moves to a fresh key pair (the policy follows), |
| 81 |
`oxy identity renew --expires 365` sets an expiry, `oxy identity delegate add bot.identity` |
| 82 |
lets another key sign for you, and `oxy identity revoke` retires a key. With several root |
| 83 |
keys, `oxy policy root add|remove|threshold` and `oxy policy sign` gather the required signatures |
| 84 |
through proposal files. |
| 85 |
|
| 86 |
## Layout |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
| `crates/oxy-core` | Library: encoding, hashing, objects, the change graph, storage, identities, policy, protocol, repository operations | |
| 91 |
| `crates/oxy-server` | Reference HTTP(S) server for the wire protocol | |
| 92 |
| `src/cli` | The `oxy` command-line interface | |
| 93 |
| `docs/spec.md` | The specification | |
| 94 |
| `docs/guide.md` | User guide, organised by task | |
| 95 |
| `docs/protocol.md` | Wire protocol for other implementers | |
| 96 |
| `docs/prompt.md` | Shell prompt integration | |
| 97 |
|
| 98 |
## Licence |
| 99 |
|
| 100 |
MIT or Apache-2.0, at your option. |