Skip to content

Commit

Permalink
improve docs (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 3, 2022
1 parent e67deab commit 1e47bc1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions git-repository/src/revision/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub use walk::iter::Walk;
pub mod spec;

/// The specification of a revision as parsed from a revision specification like `HEAD@{1}` or `v1.2.3...main`.
/// It's typically created by [`repo.rev_parse()`][crate::Repository::rev_parse()].
///
/// See the [official git documentation](https://git-scm.com/docs/git-rev-parse#_specifying_revisions) for reference on how
/// to specify revisions and revision ranges.
Expand Down
2 changes: 2 additions & 0 deletions git-repository/src/revision/spec/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub mod error;

impl<'repo> Spec<'repo> {
/// Parse `spec` and use information from `repo` to resolve it, using `opts` to learn how to deal with ambiguity.
///
/// Note that it's easier and to use [`repo.rev_parse()`][Repository::rev_parse()] instead.
pub fn from_bstr<'a>(spec: impl Into<&'a BStr>, repo: &'repo Repository, opts: Options) -> Result<Self, Error> {
let mut delegate = Delegate::new(repo, opts);
match git_revision::spec::parse(spec.into(), &mut delegate) {
Expand Down
3 changes: 2 additions & 1 deletion git-repository/src/revision/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use git_odb::FindExt;

use crate::{revision, Repository};

/// A platform to traverse the revision graph by adding starting points as well as points which shouldn't be crossed.
/// A platform to traverse the revision graph by adding starting points as well as points which shouldn't be crossed,
/// returned by [`Repository::rev_walk()`].
pub struct Platform<'repo> {
pub(crate) repo: &'repo Repository,
pub(crate) tips: Vec<ObjectId>,
Expand Down

0 comments on commit 1e47bc1

Please sign in to comment.