Skip to main content

cbh_git/
lib.rs

1#![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![cfg_attr(docsrs, doc(hidden))]
4#![expect(
5    clippy::exhaustive_structs,
6    reason = "this crate's `pub` items form an internal handoff boundary between the \
7              cargo-bench-history sub-crates rather than a stable public API, so \
8              exhaustive construction of its port value types by those in-workspace \
9              consumers is intended"
10)]
11
12//! Implementation crate for [`cargo-bench-history`]; do not depend on this directly.
13//!
14//! The process and git-history ports. The process port launches the engine command
15//! (streaming its output) and captures the output of helper commands such as `git` and
16//! `rustc`; the git-history port gives `analyze` read-only access to a repository's
17//! first-parent commit topology. Each has a real adapter backed by `tokio::process` and
18//! an in-memory fake (behind `private-test-util`) so orchestration is testable without
19//! spawning processes or a live repository. Split out of the `cargo-bench-history` shell
20//! so this subprocess-adjacent code is isolated for mutation testing.
21//!
22//! Every item is re-exported flat from the crate root, so consumers write
23//! `cbh_git::SystemGitHistory` rather than reaching into a submodule.
24//!
25//! [`cargo-bench-history`]: https://github.com/folo-rs/folo
26
27mod git;
28mod git_history;
29mod process;
30
31pub use git::parse_git_info;
32#[cfg(any(test, feature = "private-test-util"))]
33#[cfg_attr(docsrs, doc(cfg(feature = "private-test-util")))]
34pub use git_history::FakeGitHistory;
35pub use git_history::{FirstParentCommit, GitHistory, SystemGitHistory};
36pub use process::{
37    BenchRunner, CommandOutput, EngineStatus, TokioBenchRunner, capture, capture_in_worktree,
38};
39
40#[cfg(test)]
41::testing::set_allocator!();