diff --git a/CHANGELOG.md b/CHANGELOG.md index dbcde41862..1354729fa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * respect configuration for remote when fetching (also applies to pulling) [[@cruessler](https://github.com/cruessler)] ([#1093](https://github.com/extrawurst/gitui/issues/1093)) * add `:` character to sign-off trailer to comply with Conventinoal Commits standard [@semioticrobotic](https://github.com/semioticrobotic) ([#2196](https://github.com/extrawurst/gitui/issues/2196)) +### Added +* support overriding `build_date` for [reproducible builds](https://reproducible-builds.org/) [[@bmwiedemann](https://github.com/bmwiedemann)] ([#2202](https://github.com/extrawurst/gitui/pull/2202)) + ## [0.26.0+1] - 2024-04-14 -**0.26.1** +**0.26.1** this release has no changes to `0.26.0` but provides windows binaries that were missing before. **commit signing** diff --git a/build.rs b/build.rs index 64470c19f4..e217973c3f 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,5 @@ +use chrono::TimeZone; + fn get_git_hash() -> String { use std::process::Command; @@ -18,7 +20,13 @@ fn get_git_hash() -> String { } fn main() { - let build_date = chrono::Local::now().date_naive(); + let now = match std::env::var("SOURCE_DATE_EPOCH") { + Ok(val) => chrono::Local + .timestamp_opt(val.parse::().unwrap(), 0) + .unwrap(), + Err(_) => chrono::Local::now(), + }; + let build_date = now.date_naive(); let build_name = if std::env::var("GITUI_RELEASE").is_ok() { format!(