diff options
author | Katharina Fey <kookie@spacekookie.de> | 2021-01-08 03:25:31 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2021-01-09 01:47:57 +0100 |
commit | 91fc2d17524508c6c3fcf7df64f7dad21e2cf5c7 (patch) | |
tree | d211c6c0a40eb369b0d14aeec9555f1573f9b437 /apps/servers/octopus/supergit/src/lib.rs | |
parent | 441b53ad83abdeb54d208e303eaf5b573becaa15 (diff) |
supergit: update crate documentation
Diffstat (limited to '')
-rw-r--r-- | apps/servers/octopus/supergit/src/lib.rs | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/apps/servers/octopus/supergit/src/lib.rs b/apps/servers/octopus/supergit/src/lib.rs index ee02daac39c8..856c767ae787 100644 --- a/apps/servers/octopus/supergit/src/lib.rs +++ b/apps/servers/octopus/supergit/src/lib.rs @@ -1,8 +1,9 @@ -//! Read-only git repository explorer library. +//! Strongly typed git repository explorer //! -//! This library provides a more Rustic interface for libgit2, built -//! on the `git2` bindings. If you want more low-level access to your -//! repository, consider using that library instead. +//! This library provides a more Rustic interface for git +//! repositories, built on the `git2` bindings. If you want more +//! low-level access to your repository, consider using that library +//! instead. //! //! supergit aims to make queries into a git repo as typed and easy as //! possible. Start by creating a @@ -10,10 +11,25 @@ //! fetching [`Branch`](struct.Branch.html)es that you are interested //! in. //! -//! Unlike `libgit2`, this library can resolve reverse dependencies -//! between files, and their commit history. Some of these functions -//! are very computationally intensive, and will be marked with their -//! runtime cost. +//! ```no_run +//! use supergit::Repository; +//! let r = Repository::open("/path/to/repo").unwrap(); +//! println!("{:?}", r.branches()); +//! +//! let branch = r.branch("main").unwrap(); +//! let head = branch.head(); +//! println!("{}: {}", head.id(), head.summary().unwrap_or("".into())); +//! ``` +//! +//! ## Library structure +//! +//! The main abstraction layer for a repository is a set of iterators, +//! over branches, commits, and files in commit trees. Some functions +//! implemented in `supergit` are quite computationally intensive; +//! they are marked as such with their runtime cost! +//! +//! It's recommended to include [`supergit::prelude`](crate::prelude) +//! to get started with development. pub mod branch; |