git-indexer
A Rust library for extracting git repository information (branches, commits, and file diffs).
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
Extract git information from a repository:
use extract;
use Path;
What It Extracts
Branches (BranchInfo)
- Branch name (local and remote)
- Current HEAD indicator
- Commit SHA the branch points to
Commits (CommitInfo)
- Commit SHA
- Message (title)
- Author (name and email)
- Timestamp
- Parent commit SHAs
- File changes
File Changes (FileChange)
- File path
- Change type (Added, Deleted, Modified, Renamed, Copied)
- Diff hunks with line-by-line changes
Technical Details
- Pure Rust git implementation via
gix - Efficient diff generation with
imara-diff(Histogram algorithm) - Binary file detection (skips diff for binary files)
- File size limit: 10MB per file
License
MIT License - see LICENSE for details.