#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

#1953 in Data structures

Download history 62/week @ 2024-04-06 73/week @ 2024-04-13 209/week @ 2024-04-20 96/week @ 2024-04-27 141/week @ 2024-05-04 143/week @ 2024-05-11 26/week @ 2024-05-18 47/week @ 2024-05-25 88/week @ 2024-06-01 98/week @ 2024-06-08 68/week @ 2024-06-15 125/week @ 2024-06-22 101/week @ 2024-06-29 65/week @ 2024-07-06 76/week @ 2024-07-13 111/week @ 2024-07-20

380 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

~9MB
~237K SLoC