comfy_git_version/lib.rs
1#![no_std]
2
3//! Embed git information in your code at compile-time.
4//!
5//! ```
6//! use comfy_git_version::git_version;
7//! const GIT_VERSION: &str = git_version!();
8//! ```
9//!
10//! The version number will have a `-modified` suffix if your git worktree had
11//! untracked or changed files.
12//!
13//! These macros do not depend on libgit, but simply uses the `git` binary directly.
14//! So you must have `git` installed somewhere in your `PATH`.
15
16pub use comfy_git_version_macro::git_version;
17
18/// Run `git describe` at compile time with custom flags.
19///
20/// This is just a short-hand for `git_version!(args = [...])`,
21/// to be backwards compatible with earlier versions of this crate.
22#[macro_export]
23macro_rules! git_describe {
24 ($($args:tt)*) => {
25 $crate::comfy_git_version!(args = [$($args)*])
26 };
27}