Expand description
Derive Toolpath provenance documents from git repository history.
This crate converts git commit history into Toolpath Documents,
mapping branches to Paths and multi-branch views to Graphs.
§Example
use toolpath_git::{derive, DeriveConfig};
let repo = git2::Repository::open(".")?;
let config = DeriveConfig {
remote: "origin".into(),
title: None,
base: None,
};
// Single branch produces a Path document
let doc = derive(&repo, &["main".into()], &config)?;
// Multiple branches produce a Graph document
let doc = derive(&repo, &["main".into(), "feature".into()], &config)?;Structs§
- Branch
Info - Summary information about a local branch.
- Branch
Spec - Parsed branch specification.
- Derive
Config - Configuration for deriving Toolpath documents from a git repository.
Functions§
- derive
- Derive a Toolpath
Documentfrom the given repository and branch names. - derive_
graph - Derive a Toolpath
Graphfrom multiple branch specifications. - derive_
path - Derive a Toolpath
Pathfrom a single branch specification. - get_
repo_ uri - Get the repository URI from a remote, falling back to a file:// URI.
- list_
branches - List local branches with summary metadata.
- normalize_
git_ url - Normalize a git remote URL to a canonical short form.
- slugify_
author - Create a URL-safe slug from a git author name and email.