From c7844d5223c7e377e65401c344d97984a2ea8d10 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 17 Nov 2016 15:20:21 +0000 Subject: [PATCH] runtime: use proper format for git commit. Fixes #620. --- artiq/runtime.rs/build.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/artiq/runtime.rs/build.rs b/artiq/runtime.rs/build.rs index e545ea3d4..39403d146 100644 --- a/artiq/runtime.rs/build.rs +++ b/artiq/runtime.rs/build.rs @@ -13,8 +13,10 @@ fn main() { let dest_path = Path::new(&out_dir).join("git_info.rs"); let mut f = File::create(&dest_path).unwrap(); - writeln!(f, "const GIT_COMMIT: &'static str = {:?};", - git_describe().unwrap()).unwrap(); + let id = git_describe().unwrap(); + let id = id.split("-").collect::>(); + let id = format!("{}+{}.{}", id[0], id[1], id[2]); + writeln!(f, "const GIT_COMMIT: &'static str = {:?};", id).unwrap(); println!("cargo:rerun-if-changed=../../.git/HEAD"); for entry in WalkDir::new("../../.git/refs") {