Crates.io | last-git-commit |
lib.rs | last-git-commit |
version | 0.2.0 |
source | src |
created_at | 2019-07-18 01:08:15.225462 |
updated_at | 2020-04-10 00:53:01.98919 |
description | 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. |
homepage | https://github.com/olback/lgc-rs |
repository | https://github.com/olback/lgc-rs |
max_upload_size | |
id | 149786 |
size | 19,821 |
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.
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"