Expand description
Git repository information extraction.
This crate provides functionality to extract information from git repositories including branches, commits, and file changes.
§Features
- Extract branches, commits, and file changes from git repositories
- Generate diffs for file changes
§Quick Start
Extract git information:
use git_indexer::extraction::extract;
use std::path::Path;
let git_info = extract(Path::new("/path/to/repo")).unwrap();
println!("Branches: {}", git_info.branches.len());
println!("Commits: {}", git_info.commits.len());
for commit in &git_info.commits {
println!("{}: {}", &commit.id[..8], commit.message);
}§Data Model
The crate extracts the following git objects:
- Branches (
BranchInfo): Local and remote branch references - Commits (
CommitInfo): Commit metadata with parent relationships - File Changes (
FileChange): Files modified in each commit with diffs - Diff Hunks (
DiffHunk): Individual change blocks within files
Re-exports§
pub use error::Error;pub use error::Result;pub use models::BranchInfo;pub use models::ChangeType;pub use models::CommitInfo;pub use models::DiffHunk;pub use models::FileChange;pub use models::GitInfo;pub use models::TagInfo;
Modules§
- error
- Error types for the git-indexer crate.
- extraction
- Git repository extraction functionality.
- models
- Data models for git repository information.