Skip to content

Commit

Permalink
fix!: rename GITOXIDE_* environment variables to GIX_#
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Dec 6, 2023
1 parent 5fdc9df commit 2189cee
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn main() {
.and_then(|out| parse_describe(&out.stdout))
.unwrap_or_else(|| env!("CARGO_PKG_VERSION").into());

println!("cargo:rustc-env=GITOXIDE_VERSION={version}");
println!("cargo:rustc-env=GIX_VERSION={version}");
}

fn parse_describe(input: &[u8]) -> Option<String> {
Expand Down
2 changes: 1 addition & 1 deletion examples/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() {
}

#[derive(Debug, clap::Parser)]
#[clap(name = "log", about = "git log example", version = option_env!("GITOXIDE_VERSION"))]
#[clap(name = "log", about = "git log example", version = option_env!("GIX_VERSION"))]
struct Args {
/// Alternative git directory to use
#[clap(name = "dir", long = "git-dir")]
Expand Down
2 changes: 1 addition & 1 deletion examples/ls-tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {
}

#[derive(Debug, clap::Parser)]
#[clap(name = "ls-tree", about = "git ls-tree example", version = option_env!("GITOXIDE_VERSION"))]
#[clap(name = "ls-tree", about = "git ls-tree example", version = option_env!("GIX_VERSION"))]
#[clap(arg_required_else_help = true)]
struct Args {
/// Recurse into subtrees
Expand Down
2 changes: 1 addition & 1 deletion gix-discover/tests/upwards/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;
use gix_discover::repository::Kind;

fn expected_trust() -> gix_sec::Trust {
if std::env::var_os("GITOXIDE_TEST_EXPECT_REDUCED_TRUST").is_some() {
if std::env::var_os("GIX_TEST_EXPECT_REDUCED_TRUST").is_some() {
gix_sec::Trust::Reduced
} else {
gix_sec::Trust::Full
Expand Down
2 changes: 1 addition & 1 deletion gix/src/config/tree/sections/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl Core {
/// The `core.deltaBaseCacheLimit` key.
pub const DELTA_BASE_CACHE_LIMIT: keys::UnsignedInteger =
keys::UnsignedInteger::new_unsigned_integer("deltaBaseCacheLimit", &config::Tree::CORE)
.with_environment_override("GITOXIDE_PACK_CACHE_MEMORY")
.with_environment_override("GIX_PACK_CACHE_MEMORY")
.with_note("if unset, we default to a small 64 slot fixed-size cache that holds at most 64 full delta base objects of any size. Set to 0 to deactivate it entirely");
/// The `core.disambiguate` key.
pub const DISAMBIGUATE: Disambiguate =
Expand Down
2 changes: 1 addition & 1 deletion gix/src/config/tree/sections/gitoxide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ mod subsections {
pub const CACHE_LIMIT: keys::UnsignedInteger =
keys::UnsignedInteger::new_unsigned_integer("cacheLimit", &Gitoxide::OBJECTS)
.with_note("If unset or 0, there is no object cache")
.with_environment_override("GITOXIDE_OBJECT_CACHE_MEMORY");
.with_environment_override("GIX_OBJECT_CACHE_MEMORY");
/// The `gitoxide.objects.noReplace` key.
pub const NO_REPLACE: keys::Boolean = keys::Boolean::new_boolean("noReplace", &Gitoxide::OBJECTS);
/// The `gitoxide.objects.replaceRefBase` key.
Expand Down
2 changes: 1 addition & 1 deletion gix/tests/config/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ mod core {
.try_into_usize(signed(-1))
.unwrap_err()
.to_string(),
"The value of key \"core.deltaBaseCacheLimit\" (possibly from GITOXIDE_PACK_CACHE_MEMORY) could not be parsed as unsigned integer"
"The value of key \"core.deltaBaseCacheLimit\" (possibly from GIX_PACK_CACHE_MEMORY) could not be parsed as unsigned integer"
);
assert!(Core::DELTA_BASE_CACHE_LIMIT.validate("-1".into()).is_err());
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions gix/tests/gix-init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ mod with_overrides {
.set("GIT_AUTHOR_EMAIL", "author email")
.set("GIT_AUTHOR_DATE", default_date)
.set("EMAIL", "user email")
.set("GITOXIDE_PACK_CACHE_MEMORY", "0")
.set("GITOXIDE_OBJECT_CACHE_MEMORY", "5m")
.set("GIX_PACK_CACHE_MEMORY", "0")
.set("GIX_OBJECT_CACHE_MEMORY", "5m")
.set("GIT_SSL_CAINFO", "./env.pem")
.set("GIT_SSL_VERSION", "tlsv1.3")
.set("GIT_SSH_VARIANT", "ssh-variant-env")
Expand Down
4 changes: 2 additions & 2 deletions src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ pub fn main() -> Result<()> {
let mut engine = core::corpus::Engine::open_or_create(
db,
core::corpus::engine::State {
gitoxide_version: option_env!("GITOXIDE_VERSION")
.ok_or_else(|| anyhow::anyhow!("GITOXIDE_VERSION must be set in build-script"))?
gitoxide_version: option_env!("GIX_VERSION")
.ok_or_else(|| anyhow::anyhow!("GIX_VERSION must be set in build-script"))?
.into(),
progress,
trace_to_progress: trace,
Expand Down
2 changes: 1 addition & 1 deletion src/plumbing/options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use gitoxide_core as core;
use gix::bstr::BString;

#[derive(Debug, clap::Parser)]
#[clap(name = "gix", about = "The git underworld", version = option_env!("GITOXIDE_VERSION"))]
#[clap(name = "gix", about = "The git underworld", version = option_env!("GIX_VERSION"))]
#[clap(subcommand_required = true)]
#[clap(arg_required_else_help = true)]
pub struct Args {
Expand Down
2 changes: 1 addition & 1 deletion src/porcelain/options.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::path::PathBuf;

#[derive(Debug, clap::Parser)]
#[clap(about = "The rusty git", version = option_env!("GITOXIDE_VERSION"))]
#[clap(about = "The rusty git", version = option_env!("GIX_VERSION"))]
#[clap(subcommand_required = true)]
pub struct Args {
/// Do not display verbose messages and progress information
Expand Down
6 changes: 3 additions & 3 deletions tests/tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ fn fixture_bytes_inner(path: impl AsRef<Path>, root: DirectoryRoot) -> Vec<u8> {
/// In order to speed up CI and even local runs should the cache get purged, the result of each script run
/// is automatically placed into a compressed _tar_ archive.
/// If a script result doesn't exist, these will be checked first and extracted if present, which they are by default.
/// This behaviour can be prohibited by setting the `GITOXIDE_TEST_IGNORE_ARCHIVES` to any value.
/// This behaviour can be prohibited by setting the `GIX_TEST_IGNORE_ARCHIVES` to any value.
///
/// To speed CI up, one can add these archives to the repository. It's absolutely recommended to use `gix-lfs` for that to
/// not bloat the repository size.
Expand Down Expand Up @@ -631,11 +631,11 @@ fn extract_archive(
let archive_buf: Vec<u8> = {
let mut buf = Vec::new();
let input_archive = std::fs::File::open(archive)?;
if std::env::var_os("GITOXIDE_TEST_IGNORE_ARCHIVES").is_some() {
if std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!(
"Ignoring archive at '{}' as GITOXIDE_TEST_IGNORE_ARCHIVES is set.",
"Ignoring archive at '{}' as GIX_TEST_IGNORE_ARCHIVES is set.",
archive.display()
),
));
Expand Down

0 comments on commit 2189cee

Please sign in to comment.