Skip to main content

grit_lib/config/
mod.rs

1//! Configuration cascade, identity, and repository bootstrap helpers.
2//!
3//! Library guide: [mod](https://grit-scm.com/docs/library/config)
4//!
5//! ```rust
6//! use grit_lib::repo::{InitOptions, Repository};
7//! # fn main() -> grit_lib::error::Result<()> {
8//! let dir = tempfile::tempdir()?;
9//! let _repo = Repository::init(dir.path(), &InitOptions::default())?;
10//! let _cfg = _repo.config()?;
11//!
12//! # Ok(())
13//! # }
14//! ```
15mod core;
16pub mod handle;
17mod location;
18mod typed;
19
20pub use core::*;
21pub use handle::ConfigHandle;
22pub use location::{
23    add_config_value, global_config_write_path, remove_config_section, rename_config_section,
24    set_config_value, unset_all_config_values, unset_config_value, ConfigLocation,
25    ConfigWritePreview,
26};
27pub use typed::{
28    canonicalize_config_write_value, parse_typed_value, ConfigValueType, TypedConfigValue,
29};
30
31pub mod dotfile {
32    //! dotfile API (re-exported at this path).
33    pub use crate::dotfile::*;
34}
35pub mod environment {
36    //! environment API (re-exported at this path).
37    pub use crate::environment::*;
38}
39pub mod gitmodules {
40    //! gitmodules API (re-exported at this path).
41    pub use crate::gitmodules::*;
42    /// Submodule `.git` file resolution.
43    pub mod gitdir {
44        pub use crate::submodule_gitdir::*;
45    }
46}
47pub mod ident {
48    //! ident API (re-exported at this path).
49    pub use crate::ident::*;
50}
51pub mod ident_config {
52    //! ident_config API (re-exported at this path).
53    pub use crate::ident_config::*;
54}
55pub mod ident_resolve {
56    //! ident_resolve API (re-exported at this path).
57    pub use crate::ident_resolve::*;
58}
59pub mod init_filesystem {
60    //! init_filesystem API (re-exported at this path).
61    pub use crate::init_filesystem::*;
62}
63pub mod precompose_config {
64    //! precompose_config API (re-exported at this path).
65    pub use crate::precompose_config::*;
66}
67pub mod git_date {
68    //! git_date API (re-exported at this path).
69    pub use crate::git_date::*;
70}
71pub mod git_path {
72    //! git_path API (re-exported at this path).
73    pub use crate::git_path::*;
74}
75pub mod mailmap {
76    //! mailmap API (re-exported at this path).
77    pub use crate::mailmap::*;
78}