We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c16f46 + 01c26df commit d87aff8Copy full SHA for d87aff8
xtask/src/xtask.rs
@@ -64,11 +64,15 @@ fn gitrev(sh: &Shell) -> Result<String> {
64
{
65
Ok(gitrev_to_version(&rev))
66
} else {
67
- let mut desc = cmd!(sh, "git describe --tags --always").read()?;
68
- desc.insert_str(0, "0.");
+ // Grab the abbreviated commit
+ let abbrev_commit = cmd!(sh, "git rev-parse HEAD")
69
+ .read()?
70
+ .chars()
71
+ .take(10)
72
+ .collect::<String>();
73
let timestamp = git_timestamp(sh)?;
74
// We always inject the timestamp first to ensure that newer is better.
- Ok(format!("{timestamp}.{desc}"))
75
+ Ok(format!("{timestamp}.g{abbrev_commit}"))
76
}
77
78
0 commit comments