aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-13 13:22:25 +0000
committerGitHub <[email protected]>2021-03-13 13:22:25 +0000
commitceffcf8a11d0482e789cac6be1fd801a751ea10c (patch)
tree01900d736236e38f398bc59f27196df0f32f2170 /crates
parentfe4a94fff379e69acf31bf4c8b0d2490107a2dae (diff)
parent88ef0541a5110563f3f2e92532da37209d264ad9 (diff)
Merge #7984
7984: Improve version display r=matklad a=lnicola Maybe closes #7854 The version string for unreleased builds looks like this now: ``` $ rust-analyzer --version rust-analyzer 2021-03-08-159-gc0459c535 ``` Release builds should only have the tag name (`2021-03-15`). Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/build.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/rust-analyzer/build.rs b/crates/rust-analyzer/build.rs
index 5ae76ba30..999dc5928 100644
--- a/crates/rust-analyzer/build.rs
+++ b/crates/rust-analyzer/build.rs
@@ -39,8 +39,7 @@ fn set_rerun() {
39} 39}
40 40
41fn rev() -> Option<String> { 41fn rev() -> Option<String> {
42 let output = Command::new("git").args(&["rev-parse", "HEAD"]).output().ok()?; 42 let output = Command::new("git").args(&["describe", "--tags"]).output().ok()?;
43 let stdout = String::from_utf8(output.stdout).ok()?; 43 let stdout = String::from_utf8(output.stdout).ok()?;
44 let short_hash = stdout.get(0..7)?; 44 Some(stdout)
45 Some(short_hash.to_owned())
46} 45}