#git #version #build

git-version

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

10 releases

✓ Uses Rust 2018 edition

0.3.4 Jan 9, 2020
0.3.3 Oct 8, 2019
0.3.2 Aug 6, 2019
0.3.1 May 1, 2019
0.1.2 Oct 18, 2017

#12 in Build Utils

Download history 437/week @ 2019-10-13 263/week @ 2019-10-20 445/week @ 2019-10-27 455/week @ 2019-11-03 462/week @ 2019-11-10 508/week @ 2019-11-17 409/week @ 2019-11-24 608/week @ 2019-12-01 788/week @ 2019-12-08 981/week @ 2019-12-15 390/week @ 2019-12-22 1145/week @ 2019-12-29 1579/week @ 2020-01-05 1273/week @ 2020-01-12 928/week @ 2020-01-19

2,664 downloads per month
Used in 2 crates

BSD-2-Clause

5KB

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.5–0.8MB
~19K SLoC