Skip to content

Commit 103ec88

Browse files
committed
use git describe output in long version rather than just rev
Filter for only numeric tags that correspond to main releases rather than the tags for versions of library crates.
1 parent 71b66a2 commit 103ec88

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ fn main() {
4747
// Make the current git hash available to the build.
4848
if let Some(rev) = git_revision_hash() {
4949
println!("cargo:rustc-env=RIPGREP_BUILD_GIT_HASH={}", rev);
50+
println!("cargo:rerun-if-changed=.git/index");
51+
println!("cargo:rerun-if-changed=.git/HEAD");
5052
}
5153
}
5254

5355
fn git_revision_hash() -> Option<String> {
5456
let result = process::Command::new("git")
55-
.args(&["rev-parse", "--short=10", "HEAD"])
57+
.args(&["describe", "--tags", "--match=[0-9]*", "--dirty=+"])
5658
.output();
5759
result.ok().and_then(|output| {
5860
let v = String::from_utf8_lossy(&output.stdout).trim().to_string();

0 commit comments

Comments
 (0)