Struct Config

Source
pub struct Config {
    pub basedir: PathBuf,
    pub follow_symlinks: bool,
    pub same_filesystem: bool,
    pub ignored_patterns: Vec<String>,
    pub default_cmd: String,
    pub verbose: bool,
    pub show_untracked: bool,
    pub cache_file: Option<PathBuf>,
    pub manpage_file: Option<PathBuf>,
}
Expand description

A container for git-global configuration options.

Fields§

§basedir: PathBuf

The base directory to walk when searching for git repositories.

Default: $HOME.

§follow_symlinks: bool

Whether to follow symbolic links when searching for git repos.

Default: true

§same_filesystem: bool

Whether to stay on the same filesystem (as basedir) when searching for git repos on Unix or Windows.

Default: true [on supported platforms]

§ignored_patterns: Vec<String>

Path patterns to ignore when searching for git repositories.

Default: none

§default_cmd: String

The git-global subcommand to run when unspecified.

Default: status

§verbose: bool

Whether to enable verbose mode.

Default: false

§show_untracked: bool

Whether to show untracked files in output.

Default: true

§cache_file: Option<PathBuf>

Optional path to a cache file for git-global’s usage.

Default: repos.txt in the user’s XDG cache directory, if we understand XDG for the host system.

§manpage_file: Option<PathBuf>

Optional path to our manpage, regardless of whether it’s installed.

Default: git-global.1 in the relevant manpages directory, if we understand where that should be for the host system.

Implementations§

Source§

impl Config

Source

pub fn new() -> Self

Create a new Config with the default behavior, first checking global git config options in ~/.gitconfig, then using defaults:

Source

pub fn get_repos(&mut self) -> Vec<Repo>

Returns all known git repos, populating the cache first, if necessary.

Source

pub fn clear_cache(&mut self)

Clears the cache of known git repos, forcing a re-scan on the next get_repos() call.

Trait Implementations§

Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,