Expand description
Build contributor timelines from a git or GitHub repository.
contributor-graphs is primarily a command-line tool, but the same engine
is available as a library. The usual flow is analyze to turn a
repository into Contributor rows plus RepoMeta, then one of the
renderers in svg or html.
use contributor_graphs::{analyze, svg, Config};
let analysis = analyze("nf-core/rnaseq", &Config::default())?;
let rows: Vec<_> = analysis.contributors.iter().filter(|c| !c.bot).cloned().collect();
let opts = svg::SvgOptions {
title: analysis.meta.name.clone(),
..Default::default()
};
std::fs::write("rnaseq.svg", svg::render_svg(&rows, &opts))?;The lower-level modules (repo, identity, github) are public too,
for callers who want to assemble a custom pipeline.
Re-exports§
pub use model::Contributor;pub use model::RepoMeta;
Modules§
- cache
- On-disk cache that makes re-runs fast. Everything lives under one
tool-specific directory in the XDG cache location
(
$XDG_CACHE_HOME/contributor-graphs, else~/.cache/contributor-graphs): - github
- html
- identity
- model
- repo
- svg
- theme
- Visual themes for both renderers.
Structs§
- Analysis
- The result of
analyze: every contributor (bots included — filter onContributor::botif you don’t want them) and repository metadata. - Config
- How to read history and resolve identities. Construct with
Config::default()and override fields as needed.
Enums§
Functions§
- analyze
- Resolve a single repository (local path,
owner/reposlug, or git URL) into contributor data and metadata. Shorthand foranalyze_manywith one source. - analyze_
many - Resolve one or more repositories into a single combined timeline. Commits from every source are pooled, author identities are clustered across the whole pool, and commits that appear in more than one source (overlapping histories) are de-duplicated by commit SHA. Disjoint sources contribute distinct SHAs and so are simply concatenated.
- sort
- Sort contributor rows in place.