Skip to main content

Crate toolpath_git

Crate toolpath_git 

Source
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§

BranchInfo
Summary information about a local branch.
BranchSpec
Parsed branch specification.
DeriveConfig
Configuration for deriving Toolpath documents from a git repository.

Functions§

derive
Derive a Toolpath Document from the given repository and branch names.
derive_graph
Derive a Toolpath Graph from multiple branch specifications.
derive_path
Derive a Toolpath Path from 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.