Skip to content

Commit

Permalink
fix(docs): fix incorrect s/git-config/gix-config/
Browse files Browse the repository at this point in the history
3a861c8 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.
  • Loading branch information
not-my-profile committed Aug 19, 2023
1 parent 66dadf8 commit c51c8da
Show file tree
Hide file tree
Showing 32 changed files with 106 additions and 106 deletions.
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`)
Expand Down
2 changes: 1 addition & 1 deletion gix-config-value/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sebastian.thiel@icloud.com>"]
edition = "2021"
rust-version = "1.65"
Expand Down
4 changes: 2 additions & 2 deletions gix-config-value/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl TryFrom<Cow<'_, BStr>> 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)]
Expand Down Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion gix-config-value/src/integer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl TryFrom<Cow<'_, BStr>> 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)]
Expand Down
2 changes: 1 addition & 1 deletion gix-config-value/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
2 changes: 1 addition & 1 deletion gix-config-value/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions gix-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code@eddie.sh>"]
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"
Expand Down
4 changes: 2 additions & 2 deletions gix-config/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
28 changes: 14 additions & 14 deletions gix-config/src/file/access/mutate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn std::error::Error>>(())
/// ```
///
Expand All @@ -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<dyn std::error::Error>>(())
/// ```
pub fn new_section(
Expand All @@ -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<dyn std::error::Error>>(())
/// ```
///
Expand All @@ -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<dyn std::error::Error>>(())
/// ```
pub fn remove_section<'a>(
Expand Down
48 changes: 24 additions & 24 deletions gix-config/src/file/access/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<BStr>::Borrowed("b".into()),
/// Cow::<BStr>::Borrowed("c".into()),
Expand Down Expand Up @@ -231,20 +231,20 @@ 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::<BStr>::Borrowed("b".into()),
/// Cow::<BStr>::Borrowed("c".into()),
/// Cow::<BStr>::Borrowed("d".into())
/// ]
/// );
///
/// 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::<BStr>::Borrowed("g".into()),
/// Cow::<BStr>::Borrowed("g".into()),
Expand Down Expand Up @@ -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::<BStr>::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::<BStr>::Borrowed("e".into()));
/// assert_eq!(
/// gix_config.raw_values("core", None, "a")?,
/// git_config.raw_values("core", None, "a")?,
/// vec![
/// Cow::<BStr>::Borrowed("b".into()),
/// Cow::<BStr>::Borrowed("c".into()),
Expand Down Expand Up @@ -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::<BStr>::Borrowed("e".into()));
/// assert_eq!(gix_config.raw_value("core", None, "b")?, Cow::<BStr>::Borrowed("f".into()));
/// assert_eq!(git_config.raw_value("core", None, "a")?, Cow::<BStr>::Borrowed("e".into()));
/// assert_eq!(git_config.raw_value("core", None, "b")?, Cow::<BStr>::Borrowed("f".into()));
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
pub fn set_raw_value<'b, Key, E>(
Expand Down Expand Up @@ -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::<BStr>::Borrowed("x".into())));
/// assert!(fetched_config.contains(&Cow::<BStr>::Borrowed("y".into())));
/// assert!(fetched_config.contains(&Cow::<BStr>::Borrowed("z".into())));
Expand All @@ -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::<BStr>::Borrowed("x".into())));
/// assert!(fetched_config.contains(&Cow::<BStr>::Borrowed("y".into())));
/// # Ok::<(), gix_config::lookup::existing::Error>(())
Expand All @@ -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::<BStr>::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::<BStr>::Borrowed("discarded".into())));
/// # Ok::<(), gix_config::lookup::existing::Error>(())
/// ```
pub fn set_existing_raw_multi_value<'a, Iter, Item>(
Expand Down
16 changes: 8 additions & 8 deletions gix-config/src/file/access/read_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Integer>("core", None, "a")?;
/// let a_value = git_config.value::<Integer>("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<dyn std::error::Error>>(())
/// ```
pub fn value<'a, T: TryFrom<Cow<'a, BStr>>>(
Expand Down Expand Up @@ -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::<Boolean>("core", None, "a")?;
/// let a_value = git_config.values::<Boolean>("core", None, "a")?;
/// assert_eq!(
/// a_value,
/// vec![
Expand All @@ -108,7 +108,7 @@ impl<'event> File<'event> {
/// ]
/// );
/// // ... or explicitly declare the type to avoid the turbofish
/// let c_value: Vec<Boolean> = gix_config.values("core", None, "c").unwrap();
/// let c_value: Vec<Boolean> = git_config.values("core", None, "c").unwrap();
/// assert_eq!(c_value, vec![Boolean(false)]);
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
Expand Down Expand Up @@ -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<dyn std::error::Error>>(())
/// ```
#[must_use]
Expand Down
4 changes: 2 additions & 2 deletions gix-config/src/file/init/comfort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<File<'static>, init::from_env::Error> {
let home = gix_path::env::home_dir();
let options = init::Options {
Expand Down
4 changes: 2 additions & 2 deletions gix-config/src/file/init/from_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.<condition>.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<Option<File<'static>>, Error> {
use std::env;
let count: usize = match env::var("GIT_CONFIG_COUNT") {
Expand Down
2 changes: 1 addition & 1 deletion gix-config/src/file/init/from_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand Down
Loading

0 comments on commit c51c8da

Please sign in to comment.