OXYGENHUB
◆ v0.2.0 oxygen / README.md
5.9 KiB · Markdown · last changed Sign in once per hub: oxy auth login, status and logout (closes #47) 1 month ago renderedsource blame history raw
648724d8 unknown ↶ 1
# Oxygen
2
ee06a6c5 Andy McCall ↶ 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.
d02e545d Andy McCall ↶ 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
25c6adfa Andy McCall ↶ 22
## Install
23
24
Builds for Linux, macOS and Windows are on the [releases page]https://oxygenhub.io/andymccall/oxygen/releases. These are early releases: the macOS and Windows builds are not signed and have had little testing.
25
26
- **Debian, Ubuntu and other Linux with apt** (x86_64 or arm64): download `oxy_VERSION_amd64.deb` (or `_arm64.deb`) and run `sudo apt install ./oxy_VERSION_amd64.deb`. It needs glibc 2.28 or later (Debian 10, Ubuntu 20.04 and newer).
27
- **Other Linux:** unpack `oxy-VERSION-linux-x86_64.tar.gz` (or `-linux-arm64`) and put `oxy` on your `PATH`.
28
- **macOS** (Apple Silicon or Intel): unpack `oxy-VERSION-macos-arm64.tar.gz` (or `-macos-x86_64`), then `xattr -d com.apple.quarantine oxy`, since the build is not notarised, and put it on your `PATH`.
29
- **Windows:** unzip `oxy-VERSION-windows-x86_64.zip` and put the folder on your `PATH`. SmartScreen may warn on first run, since the build is not signed.
30
31
`oh`, the OxygenHub command line, is released the same way from [OxygenHub's releases]https://oxygenhub.io/andymccall/oxygenhub/releases.
32
33
Check a download against the release's `SHA256SUMS` with `sha256sum -c SHA256SUMS --ignore-missing`.
34
d02e545d Andy McCall ↶ 35
## Building
36
37
```
38
cargo build --release
39
cargo test --workspace
40
```
41
42
The binary is `target/release/oxy`.
f4324e40 unknown ↶ 43
d02e545d Andy McCall ↶ 44
## Quick start
45
46
```
47
oxy identity create --name "Your Name" --email [email protected]
48
oxy config --user core.sign change      # sign every commit
49
oxy init                                 # in a project directory
50
oxy status
51
oxy commit -m "First change"
94084087 Andy McCall ↶ 52
oxy log                                  # -n 10 for the latest ten, -v for full messages
d02e545d Andy McCall ↶ 53
```
54
94084087 Andy McCall ↶ 55
Output uses colour, glyphs, and relative times on a UTF-8 terminal, and
56
falls back to plain ASCII when piped, with `--plain`, or with `NO_COLOR` set.
57
ff1f62fe Andy McCall ↶ 58
Collaborating through a hub such as OxygenHub: sign in once, in the
59
browser, and every repository on that hub clones, fetches and pushes with it.
d02e545d Andy McCall ↶ 60
61
```
ff1f62fe Andy McCall ↶ 62
oxy auth login https://oxygenhub.io
63
oxy clone https://oxygenhub.io/owner/project
64
oxy push
65
oxy pull
66
```
67
68
Or with your own server:
69
70
```
d02e545d Andy McCall ↶ 71
oxy serve --root /srv/oxy --bind 0.0.0.0:8890 --tls-cert cert.pem --tls-key key.pem --token SECRET
ff1f62fe Andy McCall ↶ 72
echo SECRET | oxy auth login https://host:8890 --with-token
d02e545d Andy McCall ↶ 73
oxy clone https://host:8890/project
74
```
75
76
Trust policy, so a server accepts only changes from keys you have granted:
77
78
```
79
oxy policy init                          # your key becomes the root
80
oxy identity export                      # a contributor sends you this file
81
oxy policy grant alice.identity
82
oxy push                                 # publishes the policy
83
```
84
728da0f9 Andy McCall ↶ 85
Bookmarks (`oxy bookmark create|switch`, `oxy merge`), submodules (`oxy submodule add|update`),
86
partial commits (`oxy commit PATH..`, `oxy commit -i`), `oxy blame`, `oxy bisect`, `oxy squash` and
87
`oxy rebase` cover the everyday Git toolbox; see the guide.
88
30ea9c1e Andy McCall ↶ 89
Working alongside Git: `oxy git import <repo> <dest>` converts a Git history, `oxy git fetch <url>`
90
brings new commits of a Git remote into the bookmark, `oxy git push <url>` publishes the bookmark as
91
commits on top of them, and `oxy git export <dir>` writes a plain Git mirror.
92
28fc23d7 Andy McCall ↶ 93
Keys have a lifecycle: `oxy identity rotate` moves to a fresh key pair (the policy follows),
94
`oxy identity renew --expires 365` sets an expiry, `oxy identity delegate add bot.identity`
95
lets another key sign for you, and `oxy identity revoke` retires a key. With several root
96
keys, `oxy policy root add|remove|threshold` and `oxy policy sign` gather the required signatures
97
through proposal files.
98
d02e545d Andy McCall ↶ 99
## Layout
100
101
| Path | Contents |
102
|---|---|
103
| `crates/oxy-core` | Library: encoding, hashing, objects, the change graph, storage, identities, policy, protocol, repository operations |
104
| `crates/oxy-server` | Reference HTTP(S) server for the wire protocol |
105
| `src/cli` | The `oxy` command-line interface |
106
| `docs/spec.md` | The specification |
ee06a6c5 Andy McCall ↶ 107
| `docs/guide.md` | User guide, organised by task |
108
| `docs/protocol.md` | Wire protocol for other implementers |
109
| `docs/prompt.md` | Shell prompt integration |
d02e545d Andy McCall ↶ 110
111
## Licence
112
25c6adfa Andy McCall ↶ 113
MIT or Apache-2.0, at your option (see `LICENSE`).