Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fusion-engineering/rust-git-version
Compile the Git version (tag name, or hash otherwise) and dirty state into your Rust program.
https://github.com/fusion-engineering/rust-git-version
Last synced: 3 days ago
JSON representation
Compile the Git version (tag name, or hash otherwise) and dirty state into your Rust program.
- Host: GitHub
- URL: https://github.com/fusion-engineering/rust-git-version
- Owner: fusion-engineering
- License: bsd-2-clause
- Created: 2017-10-18T13:52:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-13T18:21:47.000Z (about 1 year ago)
- Last Synced: 2024-09-19T06:39:04.010Z (5 months ago)
- Language: Rust
- Homepage: https://docs.rs/git-version
- Size: 87.9 KB
- Stars: 110
- Watchers: 4
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# git-version
Embed git information in your code at compile-time.
```rust
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`.You can also get the version information for all submodules:
```rust
use git_version::git_submodule_versions;
const GIT_SUBMODULE_VERSIONS: &[(&str, &str)] = &git_submodule_versions!();for (path, version) in GIT_SUBMODULE_VERSIONS {
println!("{path}: {version}");
}
```License: BSD-2-Clause