#git #version #build

git-version

Compile the git version (tag name, or hash otherwise) and dirty state into your program

9 releases

✓ Uses Rust 2018 edition

0.3.3 Oct 8, 2019
0.3.2 Aug 6, 2019
0.3.1 May 1, 2019
0.3.0 Apr 29, 2019
0.1.2 Oct 18, 2017

#13 in Build Utils

Download history 373/week @ 2019-06-25 584/week @ 2019-07-02 344/week @ 2019-07-09 365/week @ 2019-07-16 278/week @ 2019-07-23 375/week @ 2019-07-30 462/week @ 2019-08-06 316/week @ 2019-08-13 438/week @ 2019-08-20 341/week @ 2019-08-27 339/week @ 2019-09-03 424/week @ 2019-09-10 426/week @ 2019-09-17 412/week @ 2019-09-24 334/week @ 2019-10-01

1,585 downloads per month
Used in 3 crates

BSD-2-Clause

4KB

git-version

Embed git information in your code at compile-time.

use git_version::git_version;
const GIT_VERSION: &str = git_version!();

The version number will have a -modified suffix if your git worktree had untracked or changed files.

These macros do not depend on libgit, but simply uses the git binary directly. So you must have git installed somewhere in your PATH.

License: BSD-2-Clause


lib.rs:

Embed git information in your code at compile-time.

use git_version::git_version;
const GIT_VERSION : &str = git_version!();

The version number will have a -modified suffix if your git worktree had untracked or changed files.

These macros do not depend on libgit, but simply uses the git binary directly. So you must have git installed somewhere in your PATH.

Dependencies

~0.6–0.9MB
~21K SLoC