Skip to main content

panproto_vcs/
lib.rs

1//! # panproto-vcs
2//!
3//! Schematic version control for panproto.
4//!
5//! This crate implements a git-like version control system for schema
6//! evolution. Schemas are content-addressed objects stored in a commit
7//! DAG, with branches, merge (via colimit/pushout), and data lifting
8//! through history.
9//!
10//! ## Architecture
11//!
12//! - **Object store**: [`hash`], [`object`], [`store`], [`fs_store`], [`mem_store`]
13//! - **Refs + DAG**: [`refs`], [`dag`], [`blame`], [`bisect`]
14//! - **Staging + commit**: [`index`], [`auto_mig`], [`status`]
15//! - **Merge + rewrite**: [`merge`], [`rebase`], [`cherry_pick`], [`reset`], [`stash`]
16//! - **Orchestration**: [`repo`] (composes all of the above), [`gc`]
17//!
18//! ## Quick Start
19//!
20//! ```rust
21//! use panproto_vcs::{MemStore, ObjectId, Object, Store, HeadState};
22//!
23//! let mut store = MemStore::new();
24//! assert_eq!(store.get_head().unwrap(), HeadState::Branch("main".into()));
25//! ```
26
27pub mod auto_mig;
28pub mod bisect;
29pub mod blame;
30pub mod cherry_pick;
31pub mod dag;
32pub mod data_mig;
33pub mod edit_mig;
34pub mod error;
35pub mod expr;
36pub mod fs_store;
37pub mod gat_validate;
38pub mod gc;
39pub mod hash;
40pub mod index;
41pub mod mem_store;
42pub mod merge;
43pub mod object;
44pub mod rebase;
45pub mod refs;
46pub mod rename_detect;
47pub mod repo;
48pub mod reset;
49pub mod stash;
50pub mod status;
51pub mod store;
52pub mod tree;
53
54// Re-exports for convenience.
55pub use data_mig::{StaleData, detect_staleness, migrate_backward, migrate_forward};
56pub use edit_mig::{decode_edit_log, encode_edit_log, incremental_migrate};
57pub use error::VcsError;
58pub use expr::{load_expr, store_expr};
59pub use fs_store::FsStore;
60pub use hash::ObjectId;
61pub use index::Index;
62pub use mem_store::MemStore;
63pub use object::{
64    CommitObject, CommitObjectBuilder, ComplementObject, DataSetObject, EditLogObject,
65    FileSchemaObject, Object, SchemaTreeEntry, SchemaTreeObject, TagObject,
66};
67pub use repo::{CommitOptions, Repository};
68pub use store::{HeadState, ReflogEntry, Store};
69pub use tree::{
70    assemble_from_files, assemble_schema, build_schema_tree, build_tree_from_leaves,
71    project_coproduct_protocol, resolve_commit_schema, walk_tree,
72};