Skip to main content

Crate git_stats

Crate git_stats 

Source
Expand description

git-stats aggregates per-author commit statistics from a git repository.

The crate follows an A-Frame architecture: pure logic and gix-backed repo infrastructure are peers, coordinated by the thin app layer. Both sides communicate through the plain value objects in model.

Re-exports§

pub use error::Error;

Modules§

app
Application: the thin coordinator. Follows the Logic Sandwich pattern, reading from the repository, transforming with pure logic, and reading again for numstats, then rendering. It owns no business rules of its own.
cli
error
The library’s typed error. Callers can match on named variants; the binary (main.rs) wraps this in anyhow, following the convention that libraries use thiserror and only binaries reach for anyhow.
logic
Pure logic: filtering, aggregation, sorting, and rendering. No I/O and no gix dependency, so every function here is directly unit- and property-testable.
model
Value objects: plain data passed between the pure logic and the gix infrastructure. Nothing here performs I/O or depends on gix.
repo
Infrastructure: the only module that talks to gix and the filesystem.