https://github.com/ceejbot/git-latest-commit
Makes a file available to a Rust project at build time containing the latest commit's sha and summary as static vars.
https://github.com/ceejbot/git-latest-commit
Last synced: 24 days ago
JSON representation
Makes a file available to a Rust project at build time containing the latest commit's sha and summary as static vars.
- Host: GitHub
- URL: https://github.com/ceejbot/git-latest-commit
- Owner: ceejbot
- License: isc
- Created: 2016-10-29T17:46:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-19T15:15:09.000Z (over 9 years ago)
- Last Synced: 2025-02-24T03:56:38.175Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-latest-commit
[](https://crates.io/crates/git-latest-commit)
Makes a file available to a Rust project at build time containing the latest commit's sha and summary as static vars.
Shamelessly adapted from [cstorey/git-build-version](https://github.com/cstorey/git-build-version).
Invoke this tool in your package build step. In `Cargo.toml`, add it as a build dep:
```toml
[package]
name = "something-gratuitously-mentioning-rust"
build = "build.rs"
[build-dependencies]
git-latest-commit = "0.1.3"
```
Then, in `build.rs` at the top level of your project:
```rs
extern crate git_latest_commit;
const PACKAGE_TOP_DIR : &'static str = ".";
fn main()
{
git_latest_commit::write(PACKAGE_TOP_DIR).expect("Exporting git commit info.");
}
```
## License
ISC