#git #commit #hash #simple #time

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

#743 in Data structures

Download history 6/week @ 2021-01-09 12/week @ 2021-01-16 20/week @ 2021-01-23 23/week @ 2021-01-30 32/week @ 2021-02-06 86/week @ 2021-02-13 29/week @ 2021-02-20 12/week @ 2021-02-27 2/week @ 2021-03-06 5/week @ 2021-03-13 13/week @ 2021-03-20 11/week @ 2021-03-27 11/week @ 2021-04-03 9/week @ 2021-04-10 14/week @ 2021-04-17 7/week @ 2021-04-24

82 downloads per month

MIT license

7KB
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

~10MB
~249K SLoC