git_commitgraph/
lib.rs

1//! Read, verify, and traverse git commit graphs.
2//!
3//! A [commit graph][Graph] is an index of commits in the git commit history.
4//! The [Graph] stores commit data in a way that accelerates lookups considerably compared to
5//! traversing the git history by usual means.
6//!
7//! As generating the full commit graph from scratch can take some time, git may write new commits
8//! to separate [files][file::File] instead of overwriting the original file.
9//! Eventually, git will merge these files together as the number of files grows.
10//! ## Feature Flags
11#![cfg_attr(
12    feature = "document-features",
13    cfg_attr(doc, doc = ::document_features::document_features!())
14)]
15#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
16#![deny(missing_docs, rust_2018_idioms, unsafe_code)]
17
18pub mod file;
19pub mod graph;
20
21pub use graph::Graph;
22
23/// The number of generations that are considered 'infinite' commit history.
24pub const GENERATION_NUMBER_INFINITY: u32 = 0xffff_ffff;
25/// The largest valid generation number.
26///
27/// If a commit's real generation number is larger than this, the commit graph will cap the value to
28/// this number.
29/// The largest distinct generation number is `GENERATION_NUMBER_MAX - 1`.
30pub const GENERATION_NUMBER_MAX: u32 = 0x3fff_ffff;
31
32/// The maximum number of commits that can be stored in a commit graph.
33pub const MAX_COMMITS: u32 = (1 << 30) + (1 << 29) + (1 << 28) - 1;