Shorten hash in UI

This commit is contained in:
Jeremy Soller 2024-02-28 13:38:34 -07:00
parent 536a66eff9
commit e95998c204
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 3 additions and 2 deletions

View file

@ -10,7 +10,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA");
if std::env::var_os("VERGEN_GIT_SHA").is_none() {
vergen.git_sha(true);
vergen.git_sha(false);
}
vergen.fail_on_error().emit()?;
Ok(())

View file

@ -724,6 +724,7 @@ impl App {
let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;
let repository = "https://github.com/pop-os/cosmic-edit";
let hash = env!("VERGEN_GIT_SHA");
let short_hash: String = hash.chars().take(7).collect();
let date = env!("VERGEN_GIT_COMMIT_DATE");
widget::column::with_children(vec![
widget::svg(widget::svg::Handle::from_memory(
@ -739,7 +740,7 @@ impl App {
.into(),
widget::button::link(fl!(
"git-description",
hash = hash,
hash = short_hash.as_str(),
date = date
))
.on_press(Message::LaunchUrl(format!("{}/commits/{}", repository, hash)))