Skip to content

Commit e95998c

Browse files
committed
Shorten hash in UI
1 parent 536a66e commit e95998c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1010
}
1111
println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA");
1212
if std::env::var_os("VERGEN_GIT_SHA").is_none() {
13-
vergen.git_sha(true);
13+
vergen.git_sha(false);
1414
}
1515
vergen.fail_on_error().emit()?;
1616
Ok(())

src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,7 @@ impl App {
724724
let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;
725725
let repository = "https://github.com/pop-os/cosmic-edit";
726726
let hash = env!("VERGEN_GIT_SHA");
727+
let short_hash: String = hash.chars().take(7).collect();
727728
let date = env!("VERGEN_GIT_COMMIT_DATE");
728729
widget::column::with_children(vec![
729730
widget::svg(widget::svg::Handle::from_memory(
@@ -739,7 +740,7 @@ impl App {
739740
.into(),
740741
widget::button::link(fl!(
741742
"git-description",
742-
hash = hash,
743+
hash = short_hash.as_str(),
743744
date = date
744745
))
745746
.on_press(Message::LaunchUrl(format!("{}/commits/{}", repository, hash)))

0 commit comments

Comments
 (0)