#git-commit #commit #git #hash #time #simple

last-git-commit

Simple wrapper arround git2-rs to get info about the last commit. Useful for when you want to show the git hash in a program.

3 unstable releases

0.2.0 Apr 10, 2020
0.1.1 Jul 18, 2019
0.1.0 Jul 18, 2019

#2386 in Data structures

Download history 2/week @ 2024-11-13 3/week @ 2024-11-20 7/week @ 2024-11-27 19/week @ 2024-12-04 29/week @ 2024-12-11 4/week @ 2024-12-18 2/week @ 2025-01-08 5/week @ 2025-01-15 4/week @ 2025-01-22 6/week @ 2025-01-29 53/week @ 2025-02-05 14/week @ 2025-02-12 12/week @ 2025-02-19 21/week @ 2025-02-26

102 downloads per month
Used in ocsf-codegen

MIT license

8KB
118 lines

LastGitCommit-rs

A simple wrapper arround git2-rs to easily get info about the last commit. Useful when you want to show the last commit message or the current git hash.

CircleCI docs

Simple Git Hash Example

use last_git_commit::LastGitCommit;

let lgc = LastGitCommit::new().build().unwrap();
let long = lgc.id().long();
let short = lgc.id().short();
let range = lgc.id().range(0..3).unwrap();

println!("Long: {}", long); // "c4f94258c12b8905f3d57f879ae1171ce367cd29"
println!("Short: {}", short); // "c4f9425"
println!("Range: {}", range); // "c4f"

Please see the documentation and examples.

Dependencies

~11MB
~252K SLoC