1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Strongly typed git repository explorer
//!
//! This library provides a more Rustic interface for git
//! repositories, built on the `git2` bindings.  If you want more
//! low-level access to your repository, consider using that library
//! instead.
//!
//! supergit aims to make queries into a git repo as typed and easy as
//! possible.  Start by creating a
//! [`Repository`](struct.Repository.html), and enumerating or
//! fetching [`Branch`](struct.Branch.html)es that you are interested
//! in.
//!
//! ```no_run
//! use supergit::Repository;
//! let r = Repository::open("/path/to/repo").unwrap();
//! println!("{:?}", r.branches());
//!
//! let branch = r.branch("main").unwrap();
//! let head = branch.head();
//! println!("{}: {}", head.id(), head.summary().unwrap_or("".into()));
//! ```
//!
//! ## Library structure
//!
//! The main abstraction layer for a repository is a set of iterators,
//! over branches, commits, and files in commit trees.  Some functions
//! implemented in `supergit` are quite computationally intensive;
//! they are marked as such with their runtime cost!
//!
//! It's recommended to include [`supergit::prelude`](crate::prelude)
//! to get started with development.

pub mod branch;

mod commit;
pub use commit::Commit;

mod diff;
pub use diff::Diff;

mod repo;
pub(crate) use repo::HashId;
pub use repo::Repository;

pub mod files;

/// Contains all core functions and types in supergit
pub mod prelude {
    pub use crate::branch::{Branch, BranchIter};
    pub use crate::files::{EntryType, Explorer, TreeEntry};
    pub use crate::{Commit, Diff, Repository};
}