From c51c8daee1ab54130ae3ed83ce67d08f01c4881a Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 19 Aug 2023 04:29:46 +0200 Subject: [PATCH] fix(docs): fix incorrect s/git-config/gix-config/ 3a861c8f049f6502d3bcbdac752659aa1aeda46a just blindly replaced any occurence of "git-config" or "git_config" with "gix-config"/"gix_config". There is no such thing as a gix-config file. gix-config is a git-config file parser. --- DEVELOPMENT.md | 2 +- crate-status.md | 4 +- gix-config-value/Cargo.toml | 2 +- gix-config-value/src/color.rs | 4 +- gix-config-value/src/integer.rs | 2 +- gix-config-value/src/lib.rs | 2 +- gix-config-value/src/types.rs | 2 +- gix-config/Cargo.toml | 4 +- gix-config/README.md | 4 +- gix-config/src/file/access/mutate.rs | 28 +++++------ gix-config/src/file/access/raw.rs | 48 +++++++++---------- gix-config/src/file/access/read_only.rs | 16 +++---- gix-config/src/file/init/comfort.rs | 4 +- gix-config/src/file/init/from_env.rs | 4 +- gix-config/src/file/init/from_paths.rs | 2 +- gix-config/src/file/mod.rs | 6 +-- gix-config/src/lib.rs | 10 ++-- gix-config/src/parse/events.rs | 28 +++++------ gix-config/src/parse/mod.rs | 2 +- gix-config/src/types.rs | 12 ++--- gix-config/tests/Cargo.toml | 4 +- gix-discover/src/is.rs | 2 +- gix-discover/src/upwards/types.rs | 2 +- gix/src/config/tree/keys.rs | 2 +- gix/src/config/tree/sections/core.rs | 2 +- gix/src/create.rs | 2 +- gix/src/env.rs | 2 +- gix/src/open/repository.rs | 2 +- gix/src/remote/connection/fetch/mod.rs | 2 +- .../remote/connection/fetch/receive_pack.rs | 2 +- gix/src/remote/save.rs | 2 +- gix/src/repository/reference.rs | 2 +- 32 files changed, 106 insertions(+), 106 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index f86568f6e8c..a8f98915bdd 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -79,7 +79,7 @@ There is value in organizing commits by topic and [_Stacked Git_](https://stacke ## Configuration and overrides -As a general rule, respect and implement all applicable [gix-config](https://git-scm.com/docs/gix-config) by default, but allow the +As a general rule, respect and implement all applicable [git-config](https://git-scm.com/docs/git-config) by default, but allow the caller to set overrides. How overrides work depends on the goals of the particular API so it can be done on the main call path, forcing a choice, or more typically, as a side-lane where overrides can be done on demand. diff --git a/crate-status.md b/crate-status.md index f2358adf7d5..89ce8574805 100644 --- a/crate-status.md +++ b/crate-status.md @@ -621,7 +621,7 @@ See its [README.md](https://github.com/Byron/gitoxide/blob/main/gix-lock/README. * [x] run `git credential` directly * [x] use credential helper configuration and to obtain credentials with `gix_credentials::helper::Cascade` * **config** - * [ ] facilities to apply the [url-match](https://git-scm.com/docs/gix-config#Documentation/gix-config.txt-httplturlgt) algorithm and to + * [ ] facilities to apply the [url-match](https://git-scm.com/docs/git-config#Documentation/git-config.txt-httplturlgt) algorithm and to [normalize urls](https://github.com/git/git/blob/be1a02a17ede4082a86dfbfee0f54f345e8b43ac/urlmatch.c#L109:L109) before comparison. * **traverse** * [x] commit graphs @@ -714,7 +714,7 @@ See its [README.md](https://github.com/Byron/gitoxide/blob/main/gix-lock/README. * **config** * [x] read the primitive types `boolean`, `integer`, `string` * [x] read and interpolate trusted paths - * [x] low-level API for more elaborate access to all details of `gix-config` files + * [x] low-level API for more elaborate access to all details of `git-config` files * [ ] a way to make changes to individual configuration files * [x] mailmap * [x] object replacements (`git replace`) diff --git a/gix-config-value/Cargo.toml b/gix-config-value/Cargo.toml index 4729ac4c4fc..0e3e1594f70 100644 --- a/gix-config-value/Cargo.toml +++ b/gix-config-value/Cargo.toml @@ -3,7 +3,7 @@ name = "gix-config-value" version = "0.12.5" repository = "https://github.com/Byron/gitoxide" license = "MIT OR Apache-2.0" -description = "A crate of the gitoxide project providing gix-config value parsing" +description = "A crate of the gitoxide project providing git-config value parsing" authors = ["Sebastian Thiel "] edition = "2021" rust-version = "1.65" diff --git a/gix-config-value/src/color.rs b/gix-config-value/src/color.rs index 606eef07962..7d8af6555bb 100644 --- a/gix-config-value/src/color.rs +++ b/gix-config-value/src/color.rs @@ -99,7 +99,7 @@ impl TryFrom> for Color { /// Discriminating enum for names of [`Color`] values. /// -/// `gix-config` supports the eight standard colors, their bright variants, an +/// `git-config` supports the eight standard colors, their bright variants, an /// ANSI color code, or a 24-bit hex value prefixed with an octothorpe/hash. #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] #[allow(missing_docs)] @@ -232,7 +232,7 @@ impl TryFrom<&BStr> for Name { bitflags::bitflags! { /// Discriminating enum for [`Color`] attributes. /// - /// `gix-config` supports modifiers and their negators. The negating color + /// `git-config` supports modifiers and their negators. The negating color /// attributes are equivalent to having a `no` or `no-` prefix to the normal /// variant. #[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] diff --git a/gix-config-value/src/integer.rs b/gix-config-value/src/integer.rs index b287899ecfc..7214b76e4c8 100644 --- a/gix-config-value/src/integer.rs +++ b/gix-config-value/src/integer.rs @@ -87,7 +87,7 @@ impl TryFrom> for Integer { } } -/// Integer suffixes that are supported by `gix-config`. +/// Integer suffixes that are supported by `git-config`. /// /// These values are base-2 unit of measurements, not the base-10 variants. #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] diff --git a/gix-config-value/src/lib.rs b/gix-config-value/src/lib.rs index 130674e5ad4..5b4f3fa76c3 100644 --- a/gix-config-value/src/lib.rs +++ b/gix-config-value/src/lib.rs @@ -1,4 +1,4 @@ -//! Parsing for data types used in `gix-config` files to allow their use from environment variables and other sources. +//! Parsing for data types used in `git-config` files to allow their use from environment variables and other sources. //! //! ## Feature Flags #![cfg_attr( diff --git a/gix-config-value/src/types.rs b/gix-config-value/src/types.rs index 6af0162c838..232a55f3f92 100644 --- a/gix-config-value/src/types.rs +++ b/gix-config-value/src/types.rs @@ -4,7 +4,7 @@ use crate::{color, integer}; /// collection of color (text) modifiers, or a combination of any of the /// aforementioned values, like `red` or `brightgreen`. /// -/// Note that `gix-config` allows color values to simply be a collection of +/// Note that `git-config` allows color values to simply be a collection of /// [`color::Attribute`]s, and does not require a [`color::Name`] for either the /// foreground or background color. #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)] diff --git a/gix-config/Cargo.toml b/gix-config/Cargo.toml index a1b2cd68544..515aa556dae 100644 --- a/gix-config/Cargo.toml +++ b/gix-config/Cargo.toml @@ -2,11 +2,11 @@ name = "gix-config" version = "0.27.0" repository = "https://github.com/Byron/gitoxide" -description = "A gix-config file parser and editor from the gitoxide project" +description = "A git-config file parser and editor from the gitoxide project" license = "MIT OR Apache-2.0" authors = ["Edward Shen "] edition = "2021" -keywords = ["gix-config", "git", "config", "gitoxide"] +keywords = ["git-config", "git", "config", "gitoxide"] categories = ["config", "parser-implementations"] include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"] rust-version = "1.65" diff --git a/gix-config/README.md b/gix-config/README.md index 8118d83c9cf..ada9834bc39 100644 --- a/gix-config/README.md +++ b/gix-config/README.md @@ -1,9 +1,9 @@ # gix-config -**gix-config is a library for interacting with `gix-config` files.** +**gix-config is a library for interacting with `git-config` files.** This crate intents to be a performant Rust implementation for reading and -writing `gix-config` files. It exposes tiers of abstractions, from simple +writing `git-config` files. It exposes tiers of abstractions, from simple config value wrappers to a high level reader and writer. The highlight of this crate is the zero-copy parser. We employ techniques to diff --git a/gix-config/src/file/access/mutate.rs b/gix-config/src/file/access/mutate.rs index 49de579fa86..5237b3794bb 100644 --- a/gix-config/src/file/access/mutate.rs +++ b/gix-config/src/file/access/mutate.rs @@ -130,10 +130,10 @@ impl<'event> File<'event> { /// # use std::borrow::Cow; /// # use gix_config::File; /// # use std::convert::TryFrom; - /// let mut gix_config = gix_config::File::default(); - /// let section = gix_config.new_section("hello", Some(Cow::Borrowed("world".into())))?; + /// let mut git_config = gix_config::File::default(); + /// let section = git_config.new_section("hello", Some(Cow::Borrowed("world".into())))?; /// let nl = section.newline().to_owned(); - /// assert_eq!(gix_config.to_string(), format!("[hello \"world\"]{nl}")); + /// assert_eq!(git_config.to_string(), format!("[hello \"world\"]{nl}")); /// # Ok::<(), Box>(()) /// ``` /// @@ -145,13 +145,13 @@ impl<'event> File<'event> { /// # use std::convert::TryFrom; /// # use bstr::ByteSlice; /// # use gix_config::parse::section; - /// let mut gix_config = gix_config::File::default(); - /// let mut section = gix_config.new_section("hello", Some(Cow::Borrowed("world".into())))?; + /// let mut git_config = gix_config::File::default(); + /// let mut section = git_config.new_section("hello", Some(Cow::Borrowed("world".into())))?; /// section.push(section::Key::try_from("a")?, Some("b".into())); /// let nl = section.newline().to_owned(); - /// assert_eq!(gix_config.to_string(), format!("[hello \"world\"]{nl}\ta = b{nl}")); - /// let _section = gix_config.new_section("core", None); - /// assert_eq!(gix_config.to_string(), format!("[hello \"world\"]{nl}\ta = b{nl}[core]{nl}")); + /// assert_eq!(git_config.to_string(), format!("[hello \"world\"]{nl}\ta = b{nl}")); + /// let _section = git_config.new_section("core", None); + /// assert_eq!(git_config.to_string(), format!("[hello \"world\"]{nl}\ta = b{nl}[core]{nl}")); /// # Ok::<(), Box>(()) /// ``` pub fn new_section( @@ -177,13 +177,13 @@ impl<'event> File<'event> { /// ``` /// # use gix_config::File; /// # use std::convert::TryFrom; - /// let mut gix_config = gix_config::File::try_from( + /// let mut git_config = gix_config::File::try_from( /// r#"[hello "world"] /// some-value = 4 /// "#)?; /// - /// let section = gix_config.remove_section("hello", Some("world".into())); - /// assert_eq!(gix_config.to_string(), ""); + /// let section = git_config.remove_section("hello", Some("world".into())); + /// assert_eq!(git_config.to_string(), ""); /// # Ok::<(), Box>(()) /// ``` /// @@ -192,15 +192,15 @@ impl<'event> File<'event> { /// ``` /// # use gix_config::File; /// # use std::convert::TryFrom; - /// let mut gix_config = gix_config::File::try_from( + /// let mut git_config = gix_config::File::try_from( /// r#"[hello "world"] /// some-value = 4 /// [hello "world"] /// some-value = 5 /// "#)?; /// - /// let section = gix_config.remove_section("hello", Some("world".into())); - /// assert_eq!(gix_config.to_string(), "[hello \"world\"]\n some-value = 4\n"); + /// let section = git_config.remove_section("hello", Some("world".into())); + /// assert_eq!(git_config.to_string(), "[hello \"world\"]\n some-value = 4\n"); /// # Ok::<(), Box>(()) /// ``` pub fn remove_section<'a>( diff --git a/gix-config/src/file/access/raw.rs b/gix-config/src/file/access/raw.rs index 44b318f24c0..6fef6c9ed40 100644 --- a/gix-config/src/file/access/raw.rs +++ b/gix-config/src/file/access/raw.rs @@ -157,9 +157,9 @@ impl<'event> File<'event> { /// # use std::borrow::Cow; /// # use std::convert::TryFrom; /// # use bstr::BStr; - /// # let gix_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); + /// # let git_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); /// assert_eq!( - /// gix_config.raw_values("core", None, "a").unwrap(), + /// git_config.raw_values("core", None, "a").unwrap(), /// vec![ /// Cow::::Borrowed("b".into()), /// Cow::::Borrowed("c".into()), @@ -231,9 +231,9 @@ impl<'event> File<'event> { /// # use std::borrow::Cow; /// # use std::convert::TryFrom; /// # use bstr::BStr; - /// # let mut gix_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); + /// # let mut git_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); /// assert_eq!( - /// gix_config.raw_values("core", None, "a")?, + /// git_config.raw_values("core", None, "a")?, /// vec![ /// Cow::::Borrowed("b".into()), /// Cow::::Borrowed("c".into()), @@ -241,10 +241,10 @@ impl<'event> File<'event> { /// ] /// ); /// - /// gix_config.raw_values_mut("core", None, "a")?.set_all("g"); + /// git_config.raw_values_mut("core", None, "a")?.set_all("g"); /// /// assert_eq!( - /// gix_config.raw_values("core", None, "a")?, + /// git_config.raw_values("core", None, "a")?, /// vec![ /// Cow::::Borrowed("g".into()), /// Cow::::Borrowed("g".into()), @@ -352,11 +352,11 @@ impl<'event> File<'event> { /// # use std::borrow::Cow; /// # use bstr::BStr; /// # use std::convert::TryFrom; - /// # let mut gix_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); - /// gix_config.set_existing_raw_value("core", None, "a", "e")?; - /// assert_eq!(gix_config.raw_value("core", None, "a")?, Cow::::Borrowed("e".into())); + /// # let mut git_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); + /// git_config.set_existing_raw_value("core", None, "a", "e")?; + /// assert_eq!(git_config.raw_value("core", None, "a")?, Cow::::Borrowed("e".into())); /// assert_eq!( - /// gix_config.raw_values("core", None, "a")?, + /// git_config.raw_values("core", None, "a")?, /// vec![ /// Cow::::Borrowed("b".into()), /// Cow::::Borrowed("c".into()), @@ -395,12 +395,12 @@ impl<'event> File<'event> { /// # use std::borrow::Cow; /// # use bstr::BStr; /// # use std::convert::TryFrom; - /// # let mut gix_config = gix_config::File::try_from("[core]a=b").unwrap(); - /// let prev = gix_config.set_raw_value("core", None, "a", "e")?; - /// gix_config.set_raw_value("core", None, "b", "f")?; + /// # let mut git_config = gix_config::File::try_from("[core]a=b").unwrap(); + /// let prev = git_config.set_raw_value("core", None, "a", "e")?; + /// git_config.set_raw_value("core", None, "b", "f")?; /// assert_eq!(prev.expect("present").as_ref(), "b"); - /// assert_eq!(gix_config.raw_value("core", None, "a")?, Cow::::Borrowed("e".into())); - /// assert_eq!(gix_config.raw_value("core", None, "b")?, Cow::::Borrowed("f".into())); + /// assert_eq!(git_config.raw_value("core", None, "a")?, Cow::::Borrowed("e".into())); + /// assert_eq!(git_config.raw_value("core", None, "b")?, Cow::::Borrowed("f".into())); /// # Ok::<(), Box>(()) /// ``` pub fn set_raw_value<'b, Key, E>( @@ -468,14 +468,14 @@ impl<'event> File<'event> { /// # use std::borrow::Cow; /// # use std::convert::TryFrom; /// # use bstr::BStr; - /// # let mut gix_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); + /// # let mut git_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); /// let new_values = vec![ /// "x", /// "y", /// "z", /// ]; - /// gix_config.set_existing_raw_multi_value("core", None, "a", new_values.into_iter())?; - /// let fetched_config = gix_config.raw_values("core", None, "a")?; + /// git_config.set_existing_raw_multi_value("core", None, "a", new_values.into_iter())?; + /// let fetched_config = git_config.raw_values("core", None, "a")?; /// assert!(fetched_config.contains(&Cow::::Borrowed("x".into()))); /// assert!(fetched_config.contains(&Cow::::Borrowed("y".into()))); /// assert!(fetched_config.contains(&Cow::::Borrowed("z".into()))); @@ -489,13 +489,13 @@ impl<'event> File<'event> { /// # use std::borrow::Cow; /// # use std::convert::TryFrom; /// # use bstr::BStr; - /// # let mut gix_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); + /// # let mut git_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); /// let new_values = vec![ /// "x", /// "y", /// ]; - /// gix_config.set_existing_raw_multi_value("core", None, "a", new_values.into_iter())?; - /// let fetched_config = gix_config.raw_values("core", None, "a")?; + /// git_config.set_existing_raw_multi_value("core", None, "a", new_values.into_iter())?; + /// let fetched_config = git_config.raw_values("core", None, "a")?; /// assert!(fetched_config.contains(&Cow::::Borrowed("x".into()))); /// assert!(fetched_config.contains(&Cow::::Borrowed("y".into()))); /// # Ok::<(), gix_config::lookup::existing::Error>(()) @@ -508,15 +508,15 @@ impl<'event> File<'event> { /// # use std::borrow::Cow; /// # use std::convert::TryFrom; /// # use bstr::BStr; - /// # let mut gix_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); + /// # let mut git_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); /// let new_values = vec![ /// "x", /// "y", /// "z", /// "discarded", /// ]; - /// gix_config.set_existing_raw_multi_value("core", None, "a", new_values)?; - /// assert!(!gix_config.raw_values("core", None, "a")?.contains(&Cow::::Borrowed("discarded".into()))); + /// git_config.set_existing_raw_multi_value("core", None, "a", new_values)?; + /// assert!(!git_config.raw_values("core", None, "a")?.contains(&Cow::::Borrowed("discarded".into()))); /// # Ok::<(), gix_config::lookup::existing::Error>(()) /// ``` pub fn set_existing_raw_multi_value<'a, Iter, Item>( diff --git a/gix-config/src/file/access/read_only.rs b/gix-config/src/file/access/read_only.rs index 5520c65663a..d5fd192bb7b 100644 --- a/gix-config/src/file/access/read_only.rs +++ b/gix-config/src/file/access/read_only.rs @@ -42,11 +42,11 @@ impl<'event> File<'event> { /// a = 10k /// c = false /// "#; - /// let gix_config = gix_config::File::try_from(config)?; + /// let git_config = gix_config::File::try_from(config)?; /// // You can either use the turbofish to determine the type... - /// let a_value = gix_config.value::("core", None, "a")?; + /// let a_value = git_config.value::("core", None, "a")?; /// // ... or explicitly declare the type to avoid the turbofish - /// let c_value: Boolean = gix_config.value("core", None, "c")?; + /// let c_value: Boolean = git_config.value("core", None, "c")?; /// # Ok::<(), Box>(()) /// ``` pub fn value<'a, T: TryFrom>>( @@ -96,9 +96,9 @@ impl<'event> File<'event> { /// a /// a = false /// "#; - /// let gix_config = gix_config::File::try_from(config).unwrap(); + /// let git_config = gix_config::File::try_from(config).unwrap(); /// // You can either use the turbofish to determine the type... - /// let a_value = gix_config.values::("core", None, "a")?; + /// let a_value = git_config.values::("core", None, "a")?; /// assert_eq!( /// a_value, /// vec![ @@ -108,7 +108,7 @@ impl<'event> File<'event> { /// ] /// ); /// // ... or explicitly declare the type to avoid the turbofish - /// let c_value: Vec = gix_config.values("core", None, "c").unwrap(); + /// let c_value: Vec = git_config.values("core", None, "c").unwrap(); /// assert_eq!(c_value, vec![Boolean(false)]); /// # Ok::<(), Box>(()) /// ``` @@ -210,8 +210,8 @@ impl<'event> File<'event> { /// [core "apple"] /// e = f /// "#; - /// let gix_config = gix_config::File::try_from(config)?; - /// assert_eq!(gix_config.sections_by_name("core").map_or(0, |s|s.count()), 3); + /// let git_config = gix_config::File::try_from(config)?; + /// assert_eq!(git_config.sections_by_name("core").map_or(0, |s|s.count()), 3); /// # Ok::<(), Box>(()) /// ``` #[must_use] diff --git a/gix-config/src/file/init/comfort.rs b/gix-config/src/file/init/comfort.rs index 481e29a981c..f8e624c731b 100644 --- a/gix-config/src/file/init/comfort.rs +++ b/gix-config/src/file/init/comfort.rs @@ -55,9 +55,9 @@ impl File<'static> { /// A typical use of this is to [`append`][File::append()] this configuration to another one with lower /// precedence to obtain overrides. /// - /// See [`gix-config`'s documentation] for more information on the environment variables in question. + /// See [`git-config`'s documentation] for more information on the environment variables in question. /// - /// [`gix-config`'s documentation]: https://git-scm.com/docs/gix-config#Documentation/gix-config.txt-GITCONFIGCOUNT + /// [`git-config`'s documentation]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-GITCONFIGCOUNT pub fn from_environment_overrides() -> Result, init::from_env::Error> { let home = gix_path::env::home_dir(); let options = init::Options { diff --git a/gix-config/src/file/init/from_env.rs b/gix-config/src/file/init/from_env.rs index 167d37399ad..2c487e5957a 100644 --- a/gix-config/src/file/init/from_env.rs +++ b/gix-config/src/file/init/from_env.rs @@ -31,11 +31,11 @@ pub enum Error { /// Instantiation from environment variables impl File<'static> { /// Generates a config from `GIT_CONFIG_*` environment variables or returns `Ok(None)` if no configuration was found. - /// See [`gix-config`'s documentation] for more information on the environment variables in question. + /// See [`git-config`'s documentation] for more information on the environment variables in question. /// /// With `options` configured, it's possible to resolve `include.path` or `includeIf..path` directives as well. /// - /// [`gix-config`'s documentation]: https://git-scm.com/docs/gix-config#Documentation/gix-config.txt-GITCONFIGCOUNT + /// [`git-config`'s documentation]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-GITCONFIGCOUNT pub fn from_env(options: init::Options<'_>) -> Result>, Error> { use std::env; let count: usize = match env::var("GIT_CONFIG_COUNT") { diff --git a/gix-config/src/file/init/from_paths.rs b/gix-config/src/file/init/from_paths.rs index 0eb7de69b66..ea209cefc4c 100644 --- a/gix-config/src/file/init/from_paths.rs +++ b/gix-config/src/file/init/from_paths.rs @@ -49,7 +49,7 @@ impl File<'static> { )?) } - /// Constructs a `gix-config` file from the provided metadata, which must include a path to read from or be ignored. + /// Constructs a `git-config` file from the provided metadata, which must include a path to read from or be ignored. /// Returns `Ok(None)` if there was not a single input path provided, which is a possibility due to /// [`Metadata::path`] being an `Option`. /// If an input path doesn't exist, the entire operation will abort. See [`from_paths_metadata_buf()`][Self::from_paths_metadata_buf()] diff --git a/gix-config/src/file/mod.rs b/gix-config/src/file/mod.rs index 2dd8c88fefd..e99c6eb94d9 100644 --- a/gix-config/src/file/mod.rs +++ b/gix-config/src/file/mod.rs @@ -1,4 +1,4 @@ -//! A high level wrapper around a single or multiple `gix-config` file, for reading and mutation. +//! A high level wrapper around a single or multiple `git-config` file, for reading and mutation. use std::{ borrow::Cow, collections::HashMap, @@ -66,7 +66,7 @@ pub struct Metadata { pub trust: gix_sec::Trust, } -/// A section in a gix-config file, like `[core]` or `[remote "origin"]`, along with all of its keys. +/// A section in a git-config file, like `[core]` or `[remote "origin"]`, along with all of its keys. #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] pub struct Section<'a> { header: crate::parse::section::Header<'a>, @@ -104,7 +104,7 @@ impl AddAssign for Size { /// This value does not imply any ordering between sections, as new sections /// with higher section IDs may be in between lower ID sections after `File` mutation. /// -/// We need to use a section id because `gix-config` permits sections with +/// We need to use a section id because `git-config` permits sections with /// identical names, making it ambiguous when used in maps, for instance. /// /// This id guaranteed to be unique, but not guaranteed to be compact. In other diff --git a/gix-config/src/lib.rs b/gix-config/src/lib.rs index 9b2afd69250..a62163ac337 100644 --- a/gix-config/src/lib.rs +++ b/gix-config/src/lib.rs @@ -1,7 +1,7 @@ //! # `gix_config` //! -//! This crate is a high performance `gix-config` file reader and writer. It -//! exposes a high level API to parse, read, and write [`gix-config` files]. +//! This crate is a high performance `git-config` file reader and writer. It +//! exposes a high level API to parse, read, and write [`git-config` files]. //! //! This crate has a few primary offerings and various accessory functions. The //! table below gives a brief explanation of all offerings, loosely in order @@ -10,8 +10,8 @@ //! | Offering | Description | Zero-copy? | //! | ------------- | --------------------------------------------------- | ----------------- | //! | [`File`] | Accelerated wrapper for reading and writing values. | On some reads[^1] | -//! | [`parse::State`] | Syntactic events for `gix-config` files. | Yes | -//! | value wrappers | Wrappers for `gix-config` value types. | Yes | +//! | [`parse::State`] | Syntactic events for `git-config` files. | Yes | +//! | value wrappers | Wrappers for `git-config` value types. | Yes | //! //! This crate also exposes efficient value normalization which unescapes //! characters and removes quotes through the `normalize_*` family of functions, @@ -24,7 +24,7 @@ //! //! [^1]: When read values do not need normalization and it wasn't parsed in 'owned' mode. //! -//! [`gix-config` files]: https://git-scm.com/docs/gix-config#_configuration_file +//! [`git-config` files]: https://git-scm.com/docs/git-config#_configuration_file //! [`File`]: crate::File //! [`parse::State`]: crate::parse::Events //! [`nom`]: https://github.com/Geal/nom diff --git a/gix-config/src/parse/events.rs b/gix-config/src/parse/events.rs index 24bb4525344..1a1287d642b 100644 --- a/gix-config/src/parse/events.rs +++ b/gix-config/src/parse/events.rs @@ -10,26 +10,26 @@ use crate::{ /// A type store without allocation all events that are typically preceding the first section. pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>; -/// A zero-copy `gix-config` file parser. +/// A zero-copy `git-config` file parser. /// -/// This is parser exposes low-level syntactic events from a `gix-config` file. +/// This is parser exposes low-level syntactic events from a `git-config` file. /// Generally speaking, you'll want to use [`File`] as it wraps -/// around the parser to provide a higher-level abstraction to a `gix-config` +/// around the parser to provide a higher-level abstraction to a `git-config` /// file, including querying, modifying, and updating values. /// /// This parser guarantees that the events emitted are sufficient to -/// reconstruct a `gix-config` file identical to the source `gix-config` +/// reconstruct a `git-config` file identical to the source `git-config` /// when writing it. /// /// # Differences between a `.ini` parser /// -/// While the `gix-config` format closely resembles the [`.ini` file format], +/// While the `git-config` format closely resembles the [`.ini` file format], /// there are subtle differences that make them incompatible. For one, the file /// format is not well defined, and there exists no formal specification to /// adhere to. /// /// For concrete examples, some notable differences are: -/// - `gix-config` sections permit subsections via either a quoted string +/// - `git-config` sections permit subsections via either a quoted string /// (`[some-section "subsection"]`) or via the deprecated dot notation /// (`[some-section.subsection]`). Successful parsing these section names is not /// well defined in typical `.ini` parsers. This parser will handle these cases @@ -45,7 +45,7 @@ pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>; /// which should be interpreted as `5hello world` after /// [normalization][crate::value::normalize()]. /// - Line continuations via a `\` character is supported (inside or outside of quotes) -/// - Whitespace handling similarly follows the `gix-config` specification as +/// - Whitespace handling similarly follows the `git-config` specification as /// closely as possible, where excess whitespace after a non-quoted value are /// trimmed, and line continuations onto a new line with excess spaces are kept. /// - Only equal signs (optionally padded by spaces) are valid name/value @@ -74,7 +74,7 @@ pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>; /// /// ## `Value` events do not immediately follow `Key` events /// -/// Consider the following `gix-config` example: +/// Consider the following `git-config` example: /// /// ```text /// [core] @@ -110,7 +110,7 @@ pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>; /// /// ## `KeyValueSeparator` event is not guaranteed to emit /// -/// Consider the following `gix-config` example: +/// Consider the following `git-config` example: /// /// ```text /// [core] @@ -139,7 +139,7 @@ pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>; /// /// ## Quoted values are not unquoted /// -/// Consider the following `gix-config` example: +/// Consider the following `git-config` example: /// /// ```text /// [core] @@ -175,7 +175,7 @@ pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>; /// /// ## Whitespace after line continuations are part of the value /// -/// Consider the following `gix-config` example: +/// Consider the following `git-config` example: /// /// ```text /// [some-section] @@ -183,7 +183,7 @@ pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>; /// c /// ``` /// -/// Because how `gix-config` treats continuations, the whitespace preceding `c` +/// Because how `git-config` treats continuations, the whitespace preceding `c` /// are in fact part of the value of `file`. The fully interpreted key/value /// pair is actually `file=a c`. As a result, the parser will provide this /// split value accordingly: @@ -208,7 +208,7 @@ pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>; /// /// [`File`]: crate::File /// [`.ini` file format]: https://en.wikipedia.org/wiki/INI_file -/// [`git`'s documentation]: https://git-scm.com/docs/gix-config#_configuration_file +/// [`git`'s documentation]: https://git-scm.com/docs/git-config#_configuration_file /// [`FromStr`]: std::str::FromStr /// [`From<&'_ str>`]: std::convert::From #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)] @@ -236,7 +236,7 @@ impl Events<'static> { impl<'a> Events<'a> { /// Attempt to zero-copy parse the provided bytes. On success, returns a /// [`Events`] that provides methods to accessing leading comments and sections - /// of a `gix-config` file and can be converted into an iterator of [`Event`] + /// of a `git-config` file and can be converted into an iterator of [`Event`] /// for higher level processing. /// /// Use `filter` to only include those events for which it returns true. diff --git a/gix-config/src/parse/mod.rs b/gix-config/src/parse/mod.rs index e943a22b486..e11bbc1e355 100644 --- a/gix-config/src/parse/mod.rs +++ b/gix-config/src/parse/mod.rs @@ -1,4 +1,4 @@ -//! This module handles parsing a `gix-config` file. Generally speaking, you +//! This module handles parsing a `git-config` file. Generally speaking, you //! want to use a higher abstraction such as [`File`] unless you have some //! explicit reason to work with events instead. //! diff --git a/gix-config/src/types.rs b/gix-config/src/types.rs index 7110906b866..5abd4878501 100644 --- a/gix-config/src/types.rs +++ b/gix-config/src/types.rs @@ -47,10 +47,10 @@ pub enum Source { EnvOverride, } -/// High level `gix-config` reader and writer. +/// High level `git-config` reader and writer. /// /// This is the full-featured implementation that can deserialize, serialize, -/// and edit `gix-config` files without loss of whitespace or comments. +/// and edit `git-config` files without loss of whitespace or comments. /// /// # 'multivar' behavior /// @@ -88,8 +88,8 @@ pub enum Source { /// ``` /// # use std::borrow::Cow; /// # use std::convert::TryFrom; -/// # let gix_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); -/// assert_eq!(gix_config.raw_value("core", None, "a").unwrap().as_ref(), "d"); +/// # let git_config = gix_config::File::try_from("[core]a=b\n[core]\na=c\na=d").unwrap(); +/// assert_eq!(git_config.raw_value("core", None, "a").unwrap().as_ref(), "d"); /// ``` /// /// Consider the `multi` variants of the methods instead, if you want to work @@ -104,7 +104,7 @@ pub enum Source { #[derive(Eq, Clone, Debug, Default)] pub struct File<'event> { /// The list of events that occur before any section. Since a - /// `gix-config` file prohibits global values, this vec is limited to only + /// `git-config` file prohibits global values, this vec is limited to only /// comment, newline, and whitespace events. pub(crate) frontmatter_events: crate::parse::FrontMatterEvents<'event>, /// Frontmatter events to be placed after the given section. @@ -113,7 +113,7 @@ pub struct File<'event> { /// variant of `SectionBodyIds`. pub(crate) section_lookup_tree: HashMap, Vec>>, /// This indirection with the SectionId as the key is critical to flexibly - /// supporting `gix-config` sections, as duplicated keys are permitted. + /// supporting `git-config` sections, as duplicated keys are permitted. pub(crate) sections: HashMap>, /// Internal monotonically increasing counter for section ids. pub(crate) section_id_counter: usize, diff --git a/gix-config/tests/Cargo.toml b/gix-config/tests/Cargo.toml index 93fed76a53b..48aec5ac1c3 100644 --- a/gix-config/tests/Cargo.toml +++ b/gix-config/tests/Cargo.toml @@ -2,11 +2,11 @@ name = "gix-config-tests" version = "0.0.0" repository = "https://github.com/Byron/gitoxide" -description = "A gix-config file parser and editor from the gitoxide project" +description = "A git-config file parser and editor from the gitoxide project" license = "MIT OR Apache-2.0" authors = ["Edward Shen "] edition = "2021" -keywords = ["gix-config", "git", "config", "gitoxide"] +keywords = ["git-config", "git", "config", "gitoxide"] categories = ["config", "parser-implementations"] include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"] rust-version = "1.65" diff --git a/gix-discover/src/is.rs b/gix-discover/src/is.rs index 7b569cf5aef..add827c83b2 100644 --- a/gix-discover/src/is.rs +++ b/gix-discover/src/is.rs @@ -114,7 +114,7 @@ pub fn submodule_git_dir(git_dir: impl AsRef) -> bool { } /// What constitutes a valid git repository, returning the guessed repository kind -/// purely based on the presence of files. Note that the gix-config ultimately decides what's bare. +/// purely based on the presence of files. Note that the git-config ultimately decides what's bare. /// /// Returns the `Kind` of git directory that was passed, possibly alongside the supporting private worktree git dir. /// diff --git a/gix-discover/src/upwards/types.rs b/gix-discover/src/upwards/types.rs index 370a3ae9858..bf7a7cdea3c 100644 --- a/gix-discover/src/upwards/types.rs +++ b/gix-discover/src/upwards/types.rs @@ -86,7 +86,7 @@ impl Options<'_> { /// - `GIT_CEILING_DIRECTORIES` for `ceiling_dirs` /// /// Note that `GIT_DISCOVERY_ACROSS_FILESYSTEM` for `cross_fs` is **not** read, - /// as it requires parsing of `gix-config` style boolean values. + /// as it requires parsing of `git-config` style boolean values. /// /// In addition, this function disables `match_ceiling_dir_or_error` to allow /// discovery if an outside environment variable sets non-matching ceiling directories. diff --git a/gix/src/config/tree/keys.rs b/gix/src/config/tree/keys.rs index b03fa49c6dc..5a5257af5c0 100644 --- a/gix/src/config/tree/keys.rs +++ b/gix/src/config/tree/keys.rs @@ -464,7 +464,7 @@ mod remote_name { } } -/// Provide a way to validate a value, or decode a value from `gix-config`. +/// Provide a way to validate a value, or decode a value from `git-config`. pub trait Validate { /// Validate `value` or return an error. fn validate(&self, value: &BStr) -> Result<(), Box>; diff --git a/gix/src/config/tree/sections/core.rs b/gix/src/config/tree/sections/core.rs index f6903737c55..7253140c102 100644 --- a/gix/src/config/tree/sections/core.rs +++ b/gix/src/config/tree/sections/core.rs @@ -306,7 +306,7 @@ mod log_all_ref_updates { impl LogAllRefUpdates { /// Returns the mode for ref-updates as parsed from `value`. If `value` is not a boolean, we try /// to interpret the string value instead. For correctness, this two step process is necessary as - /// the interpretation of booleans in special in `gix-config`, i.e. we can't just treat it as string. + /// the interpretation of booleans in special in `git-config`, i.e. we can't just treat it as string. pub fn try_into_ref_updates( &'static self, value: Option>, diff --git a/gix/src/create.rs b/gix/src/create.rs index a30f3d6790c..4cc01402c07 100644 --- a/gix/src/create.rs +++ b/gix/src/create.rs @@ -114,7 +114,7 @@ pub struct Options { /// /// By default repos with worktree can be initialized into a non-empty repository as long as there is no `.git` directory. pub destination_must_be_empty: bool, - /// If set, use these filesystem capabilities to populate the respective gix-config fields. + /// If set, use these filesystem capabilities to populate the respective git-config fields. /// If `None`, the directory will be probed. pub fs_capabilities: Option, } diff --git a/gix/src/env.rs b/gix/src/env.rs index ce5461bcc33..915afe807c6 100644 --- a/gix/src/env.rs +++ b/gix/src/env.rs @@ -20,7 +20,7 @@ pub fn args_os() -> impl Iterator { /// Equivalent to `std::env::args_os()`, but with precomposed unicode on MacOS and other apple platforms. /// -/// Note that this ignores `core.precomposeUnicode` as gix-config isn't available yet. It's default enabled in modern git though. +/// Note that this ignores `core.precomposeUnicode` as git-config isn't available yet. It's default enabled in modern git though. #[cfg(target_vendor = "apple")] pub fn args_os() -> impl Iterator { use unicode_normalization::UnicodeNormalization; diff --git a/gix/src/open/repository.rs b/gix/src/open/repository.rs index d1be4c07f16..9f1df228f7e 100644 --- a/gix/src/open/repository.rs +++ b/gix/src/open/repository.rs @@ -105,7 +105,7 @@ impl ThreadSafeRepository { /// Note that this will read various `GIT_*` environment variables to check for overrides, and is probably most useful when implementing /// custom hooks. // TODO: tests, with hooks, GIT_QUARANTINE for ref-log and transaction control (needs gix-sec support to remove write access in gix-ref) - // TODO: The following vars should end up as overrides of the respective configuration values (see gix-config). + // TODO: The following vars should end up as overrides of the respective configuration values (see git-config). // GIT_PROXY_SSL_CERT, GIT_PROXY_SSL_KEY, GIT_PROXY_SSL_CERT_PASSWORD_PROTECTED. // GIT_PROXY_SSL_CAINFO, GIT_SSL_CIPHER_LIST, GIT_HTTP_MAX_REQUESTS, GIT_CURL_FTP_NO_EPSV, pub fn open_with_environment_overrides( diff --git a/gix/src/remote/connection/fetch/mod.rs b/gix/src/remote/connection/fetch/mod.rs index 0ba73c3530b..8327d5abcb2 100644 --- a/gix/src/remote/connection/fetch/mod.rs +++ b/gix/src/remote/connection/fetch/mod.rs @@ -167,7 +167,7 @@ where /// Note that at this point, the `transport` should already be configured using the [`transport_mut()`][Self::transport_mut()] /// method, as it will be consumed here. /// - /// From there additional properties of the fetch can be adjusted to override the defaults that are configured via gix-config. + /// From there additional properties of the fetch can be adjusted to override the defaults that are configured via git-config. /// /// # Async Experimental /// diff --git a/gix/src/remote/connection/fetch/receive_pack.rs b/gix/src/remote/connection/fetch/receive_pack.rs index 2e324cd84bd..089fe295721 100644 --- a/gix/src/remote/connection/fetch/receive_pack.rs +++ b/gix/src/remote/connection/fetch/receive_pack.rs @@ -30,7 +30,7 @@ impl<'remote, 'repo, T> Prepare<'remote, 'repo, T> where T: Transport, { - /// Receive the pack and perform the operation as configured by git via `gix-config` or overridden by various builder methods. + /// Receive the pack and perform the operation as configured by git via `git-config` or overridden by various builder methods. /// Return `Ok(None)` if there was nothing to do because all remote refs are at the same state as they are locally, or `Ok(Some(outcome))` /// to inform about all the changes that were made. /// diff --git a/gix/src/remote/save.rs b/gix/src/remote/save.rs index ad6a75b142b..a61df64c0d6 100644 --- a/gix/src/remote/save.rs +++ b/gix/src/remote/save.rs @@ -25,7 +25,7 @@ pub enum AsError { Name(#[from] crate::remote::name::Error), } -/// Serialize into gix-config. +/// Serialize into git-config. impl Remote<'_> { /// Save ourselves to the given `config` if we are a named remote or fail otherwise. /// diff --git a/gix/src/repository/reference.rs b/gix/src/repository/reference.rs index d34c790879f..0428699e533 100644 --- a/gix/src/repository/reference.rs +++ b/gix/src/repository/reference.rs @@ -124,7 +124,7 @@ impl crate::Repository { /// Edit one or more references as described by their `edits`. /// Note that one can set the committer name for use in the ref-log by temporarily - /// [overriding the gix-config][crate::Repository::config_snapshot_mut()]. + /// [overriding the git-config][crate::Repository::config_snapshot_mut()]. /// /// Returns all reference edits, which might be more than where provided due the splitting of symbolic references, and /// whose previous (_old_) values are the ones seen on in storage after the reference was locked.