graft commit
Snapshot the current branch state into the DAG. This creates a permanent, cryptographically-verifiable save point.
Usage
Behavior
- Stop container — Database must be at rest for a consistent snapshot
- Hash files — Walk the branch directory, BLAKE3-hash every file
- Store blobs — Put each file into the object pool (keyed by content hash, deduplicated)
- Build Merkle tree — Sort leaves by path, pair-hash up to a single root
- Insert into DAG — Write commit + tree entries to SQLite (atomic transaction)
- Update ref — Advance the branch ref to the new commit
- Start container — Only if it was running before
Flags
| Flag | Alias | Default | Description |
|---|---|---|---|
--message | -m | "Commit at <timestamp>" | Commit message |
Examples
Basic Commit
How Hashing Works
Graft computes a BLAKE3 hash for every file in the branch directory, excluding socket files (*.sock), PID files (*.pid), and postmaster.pid. Each leaf hash incorporates both the file’s relative path and its content hash:
Commit Hash
The 7-character commit hash is computed as:Exit Codes
| Code | Meaning |
|---|---|
0 | Commit created successfully |
1 | Error (not initialized, branch not found, container issue) |