4 releases

0.1.3 Aug 30, 2024
0.1.2 Apr 29, 2020
0.1.1 Dec 7, 2019
0.1.0 Nov 27, 2019

#135 in Build Utils

Download history 6301/week @ 2024-08-17 6534/week @ 2024-08-24 7198/week @ 2024-08-31 6549/week @ 2024-09-07 5569/week @ 2024-09-14 6100/week @ 2024-09-21 8015/week @ 2024-09-28 6297/week @ 2024-10-05 5947/week @ 2024-10-12 6615/week @ 2024-10-19 5717/week @ 2024-10-26 6049/week @ 2024-11-02 7681/week @ 2024-11-09 7433/week @ 2024-11-16 7545/week @ 2024-11-23 5526/week @ 2024-11-30

29,184 downloads per month
Used in 41 crates (30 directly)

Apache-2.0

1MB
259 lines

Contains (WOFF font, 400KB) NanumBarunGothic-00000000f861df9d.ttf.woff2, (WOFF font, 135KB) FiraSans-Medium-0000000066e2bc86.woff2, (WOFF font, 130KB) FiraSans-Regular-0000000084b1ad12.woff2, (WOFF font, 82KB) SourceSerif4-Bold-00000000ad926a49.ttf.woff2, (WOFF font, 77KB) SourceSerif4-Regular-0000000007da4a04.ttf.woff2, (WOFF font, 45KB) SourceCodePro-It-00000000668aca82.ttf.woff2 and 3 more.

git_info

crates.io CI codecov
license Libraries.io for GitHub Documentation downloads
Built with cargo-make

Extracts git repository information.

Overview

This library main goal is to provide development/build tools such as cargo-make the needed information on the current git repository.

Usage

Simply include the library and invoke the get function to pull all info as follows:

fn main() {
    let info = git_info::get();

    println!(
        "User Name: {}",
        info.user_name.unwrap_or("Unknown".to_string())
    );
    println!(
        "User Email: {}",
        info.user_email.unwrap_or("Unknown".to_string())
    );
    println!("Dirty: {}", info.dirty.unwrap_or(false));
    println!(
        "Current Branch: {}",
        info.current_branch.unwrap_or("Unknown".to_string())
    );

    println!(
        "Last Commit Hash: {}",
        info.head.last_commit_hash.unwrap_or("Unknown".to_string())
    );
    println!(
        "Last Commit Hash (short): {}",
        info.head
            .last_commit_hash_short
            .unwrap_or("Unknown".to_string())
    );

    println!("Config: {:#?}", info.config.unwrap());
    println!("Branches: {:#?}", info.branches.unwrap_or(vec![]));
}

Installation

In order to use this library, just add it as a dependency:

[dependencies]
git_info = "^0.1.3"

API Documentation

See full docs at: API Docs

Contributing

See contributing guide

Release History

See Changelog

License

Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.

Dependencies