git_indexer/lib.rs
1//! Git repository information extraction.
2//!
3//! This crate provides functionality to extract information from git repositories
4//! including branches, commits, and file changes.
5//!
6//! # Features
7//!
8//! - Extract branches, commits, and file changes from git repositories
9//! - Generate diffs for file changes
10//!
11//! # Quick Start
12//!
13//! Extract git information:
14//!
15//! ```no_run
16//! use git_indexer::extraction::extract;
17//! use std::path::Path;
18//!
19//! let git_info = extract(Path::new("/path/to/repo")).unwrap();
20//!
21//! println!("Branches: {}", git_info.branches.len());
22//! println!("Commits: {}", git_info.commits.len());
23//!
24//! for commit in &git_info.commits {
25//! println!("{}: {}", &commit.id[..8], commit.message);
26//! }
27//! ```
28//!
29//! # Data Model
30//!
31//! The crate extracts the following git objects:
32//!
33//! - **Branches** ([`BranchInfo`]): Local and remote branch references
34//! - **Commits** ([`CommitInfo`]): Commit metadata with parent relationships
35//! - **File Changes** ([`FileChange`]): Files modified in each commit with diffs
36//! - **Diff Hunks** ([`DiffHunk`]): Individual change blocks within files
37
38pub mod error;
39pub mod extraction;
40pub mod models;
41
42// Re-export main types for convenience
43pub use error::{Error, Result};
44pub use models::{BranchInfo, ChangeType, CommitInfo, DiffHunk, FileChange, GitInfo, TagInfo};