git_global/
lib.rs

1//! Keep track of all the git repositories on your machine.
2//!
3//! This crate houses the binary and library for the git-global subcommand, a
4//! way to find, query statuses, and gain other insights about all the git repos
5//! on your machine. The binary can be installed with cargo: `cargo install
6//! git-global`.
7//!
8//! # Command-line Usage
9//!
10//! ```bash
11//! $ git global [status]  # show `git status -s` for all your git repos
12//! $ git global info      # show information about git-global itself
13//! $ git global list      # show all git repos git-global knows about
14//! $ git global scan      # search your filesystem for git repos and update cache
15//! # ...
16//! $ git global help      # show usage and all subcommands
17//! ```
18//!
19//! # Public Interface
20//!
21//! The git-global project's primary goal is to produce a useful binary. There's
22//! no driving force to provide a very good library for other Rust projects to
23//! use, so this documentation primarily serves to illustrate how the codebase
24//! is structured. (If a library use-case arises, however, that would be fine.)
25//!
26//! The [`Repo`] struct is a git repository that is identified by the full path
27//! to its base directory (instead of, say, its `.git` directory).
28//!
29//! The [`Config`] struct holds a user's git-global configuration information,
30//! which usually merges some default values with values in the `[global]`
31//! section of the user's global `.gitconfig` file. It provides access to the
32//! list of known `Repo`s via the `get_repos()` method, which reads from a cache
33//! file, populating it for the first time after performing a filesystem scan,
34//! if necessary.
35//!
36//! A [`Report`] contains messages added by a subcommand about the overall
37//! results of what it did, as well as messages about the specific `Repo`s to
38//! which that subcommand applies. All subcommand modules expose an `execute()`
39//! function that takes ownership of a `Config` struct and returns a
40//! `Result<Report>`. These subcommands live in the [`subcommands`][subcommands]
41//! module.
42//!
43//! The [`run_from_command_line()`][rfcl] function handles running git-global
44//! from the command line and serves as the entry point for the binary.
45//!
46//! [`Config`]: struct.Config.html
47//! [`Repo`]: struct.Repo.html
48//! [`Report`]: struct.Report.html
49//! [rfcl]: fn.run_from_command_line.html
50//! [subcommands]: subcommands/index.html
51
52mod cli;
53mod config;
54mod errors;
55mod repo;
56mod report;
57pub mod subcommands; // Using `pub mod` so we see the docs.
58
59pub use cli::{get_clap_app, run_from_command_line};
60pub use config::Config;
61pub use errors::{GitGlobalError, Result};
62pub use repo::Repo;
63pub use report::Report;