| Crates.io | git-commits |
| lib.rs | git-commits |
| version | 0.1.0 |
| created_at | 2023-05-28 15:16:44.836217+00 |
| updated_at | 2025-05-23 02:15:47.882745+00 |
| description | Simple library for iterating git commits and changes |
| homepage | |
| repository | https://github.com/vallentin/git-commits |
| max_upload_size | |
| id | 876566 |
| size | 51,517 |
Abstraction of git2 providing a simple interface
for easily iterating over commits and changes in a
Git repository.
In short, both git log --name-status and
git log --stat --format=fuller can be
implemented with just a handful of lines.
let repo = git_commits::open("path-to-repo")?;
for commit in repo.commits()? {
// The `commit` contains the message, author, committer, time, etc
let commit = commit?;
println!("\n{}", commit);
for change in commit.changes()? {
// The `change` contains change kind, old/new path, old/new sizes, etc
let change = change?;
println!(" {}", change);
// match change {
// Change::Added(change) => {}
// Change::Modified(change) => {}
// Change::Deleted(change) => {}
// Change::Renamed(change) => {}
// }
}
}