From e95998c2046379683f92e3743c552d1c7a51ff93 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Feb 2024 13:38:34 -0700 Subject: [PATCH] Shorten hash in UI --- build.rs | 2 +- src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 7714837..be10241 100644 --- a/build.rs +++ b/build.rs @@ -10,7 +10,7 @@ fn main() -> Result<(), Box> { } 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(()) diff --git a/src/main.rs b/src/main.rs index f881b45..92a3175 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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)))