Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove git2 from built #4227

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ self_update = { version = "0.42", default-features = false, features = [
sevenz-rust = "0.6"

[build-dependencies]
built = { version = "0.7", features = ["chrono", "git2"] }
built = { version = "0.7", features = ["chrono"] }
cfg_aliases = "0.2"
heck = "0.5"
toml = "0.8"
Expand Down
4 changes: 0 additions & 4 deletions src/build_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ pub mod built_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
}

pub fn git_sha() -> &'static Option<&'static str> {
&built_info::GIT_COMMIT_HASH_SHORT
}

pub static BUILD_TIME: Lazy<DateTime<FixedOffset>> =
Lazy::new(|| DateTime::parse_from_rfc2822(built_info::BUILT_TIME_UTC).unwrap());

Expand Down
9 changes: 2 additions & 7 deletions src/cli/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use eyre::Result;
use std::sync::LazyLock as Lazy;
use versions::Versioning;

use crate::build_time::{git_sha, BUILD_TIME};
use crate::build_time::BUILD_TIME;
use crate::cli::self_update::SelfUpdate;
#[cfg(not(test))]
use crate::config::Settings;
Expand Down Expand Up @@ -44,7 +44,6 @@ impl Version {
"os": *OS,
"arch": *ARCH,
"build_time": BUILD_TIME.to_string(),
"git_sha": git_sha(),
});
println!("{}", serde_json::to_string_pretty(&json)?);
Ok(())
Expand All @@ -67,11 +66,7 @@ pub static VERSION: Lazy<String> = Lazy::new(|| {
v.push_str("-DEBUG");
};
let build_time = BUILD_TIME.format("%Y-%m-%d");
let extra = match git_sha() {
Some(sha) => format!("({} {})", sha, build_time),
_ => format!("({})", build_time),
};
format!("{v} {os}-{arch} {extra}", os = *OS, arch = *ARCH)
format!("{v} {os}-{arch} ({build_time})", os = *OS, arch = *ARCH)
});

static AFTER_LONG_HELP: &str = color_print::cstr!(
Expand Down
Loading