zerogit/
lib.rs

1//! # zerogit
2//!
3//! A lightweight, pure Rust Git client library.
4//!
5//! This crate provides Git repository operations without external dependencies
6//! like libgit2 or the git command-line tool.
7//!
8//! ## Features
9//!
10//! - Read Git repositories (loose objects only, no pack files yet)
11//! - Navigate commits, trees, and blobs
12//! - Read branches and HEAD
13//! - Query working tree status
14//! - Read index (staging area)
15//!
16//! ## Quick Start
17//!
18//! ```no_run
19//! use zerogit::{Repository, Result};
20//!
21//! fn main() -> Result<()> {
22//!     // Open a repository
23//!     let repo = Repository::open("path/to/repo")?;
24//!
25//!     // Get HEAD
26//!     let head = repo.head()?;
27//!     println!("On branch: {:?}", head.branch_name());
28//!
29//!     // Read a commit
30//!     let commit = repo.commit(&head.oid().to_hex())?;
31//!     println!("Latest commit: {}", commit.summary());
32//!
33//!     // Check status
34//!     for entry in repo.status()? {
35//!         println!("{:?}: {}", entry.status(), entry.path().display());
36//!     }
37//!
38//!     Ok(())
39//! }
40//! ```
41//!
42//! ## Module Overview
43//!
44//! - [`error`] - Error types and Result alias
45//! - [`repository`] - Main `Repository` type for accessing Git data
46//! - [`objects`] - Git object types (blob, tree, commit)
47//! - [`refs`] - References (HEAD, branches)
48//! - [`index`] - Index (staging area) operations
49//! - [`status`] - Working tree status
50
51pub mod config;
52pub mod diff;
53pub mod error;
54pub mod index;
55pub mod log;
56pub mod objects;
57pub mod refs;
58pub mod repository;
59pub mod status;
60
61// Internal modules (not part of public API)
62pub(crate) mod infra;
63
64// Re-export primary types for convenient access
65pub use config::{Config, ConfigLevel};
66pub use error::{Error, Result};
67pub use repository::Repository;
68
69// Re-export object types
70pub use objects::{Blob, Commit, FileMode, Object, Oid, Signature, Tree, TreeEntry};
71
72// Re-export reference types
73pub use refs::{Branch, Head, RemoteBranch, Tag};
74
75// Re-export status types
76pub use status::{FileStatus, StatusEntry};
77
78// Re-export index types
79pub use index::{Index, IndexEntry};
80
81// Re-export log types
82pub use log::LogOptions;
83
84// Re-export diff types
85pub use diff::{DiffDelta, DiffStats, DiffStatus, TreeDiff};