mirror of
https://github.com/Byron/gitoxide
synced 2025-10-06 01:52:40 +02:00
Small documentation fixes
Small grammar and spelling changes to make the codebase better.
This commit is contained in:
@@ -17,7 +17,7 @@ pub struct Context<W> {
|
||||
pub file_stats: bool,
|
||||
/// Collect how many lines in files have been added, removed and modified (without rename tracking).
|
||||
pub line_stats: bool,
|
||||
/// The amount of threads to use. If unset, use all cores, if 0 use al physical cores.
|
||||
/// The number of threads to use. If unset, use all cores, if 0 use all physical cores.
|
||||
pub threads: Option<usize>,
|
||||
/// Omit unifying identities by name and email which can lead to the same author appear multiple times
|
||||
/// due to using different names or email addresses.
|
||||
|
@@ -80,7 +80,7 @@ pub struct Options {
|
||||
pub format: Format,
|
||||
/// Given a `path`, originating in the git tree, to place into the archive, put `<prefix>/path` in front of it.
|
||||
///
|
||||
/// Note that that `/` should be used as separator, and that a prefix directory has to end with `/`.
|
||||
/// Note that `/` should be used as separator, and that a prefix directory has to end with `/`.
|
||||
pub tree_prefix: Option<BString>,
|
||||
/// The modification time for all entries in the archive as seen since UNIX epoch.
|
||||
///
|
||||
|
@@ -159,7 +159,7 @@ mod prepare {
|
||||
/// Set the name or path to the shell `program` to use if a shell is to be used, to avoid
|
||||
/// using the default shell which is `sh`.
|
||||
///
|
||||
/// Note that that shells that are not Bourne-style cannot be expected to work correctly,
|
||||
/// Note that shells that are not Bourne-style cannot be expected to work correctly,
|
||||
/// because POSIX shell syntax is assumed when searching for and conditionally adding
|
||||
/// `"$@"` to receive arguments, where applicable (and in the behaviour of
|
||||
/// [`with_quoted_command()`](Self::with_quoted_command()), if called).
|
||||
|
@@ -38,11 +38,11 @@ pub fn build_thread() -> std::thread::Builder {
|
||||
}
|
||||
|
||||
/// Read items from `input` and `consume` them in multiple threads,
|
||||
/// whose output output is collected by a `reducer`. Its task is to
|
||||
/// aggregate these outputs into the final result returned by this function with the benefit of not having to be thread-safe.
|
||||
/// whose output is collected by a `reducer`. Its task is to
|
||||
/// aggregate these outputs into the final result returned by this function, with the benefit of not having to be thread-safe.
|
||||
///
|
||||
/// * if `thread_limit` is `Some`, the given amount of threads will be used. If `None`, all logical cores will be used.
|
||||
/// * `new_thread_state(thread_number) -> State` produces thread-local state once per thread to be based to `consume`
|
||||
/// * if `thread_limit` is `Some`, then the given number of threads will be used. If `None`, all logical cores will be used.
|
||||
/// * `new_thread_state(thread_number) -> State` produces thread-local state once per thread to be passed to `consume`
|
||||
/// * `consume(Item, &mut State) -> Output` produces an output given an input obtained by `input` along with mutable state initially
|
||||
/// created by `new_thread_state(…)`.
|
||||
/// * For `reducer`, see the [`Reduce`] trait
|
||||
@@ -103,12 +103,12 @@ where
|
||||
}
|
||||
|
||||
/// Read items from `input` and `consume` them in multiple threads,
|
||||
/// whose output output is collected by a `reducer`. Its task is to
|
||||
/// whose output is collected by a `reducer`. Its task is to
|
||||
/// aggregate these outputs into the final result returned by this function with the benefit of not having to be thread-safe.
|
||||
/// Caall `finalize` to finish the computation, once per thread, if there was no error sending results earlier.
|
||||
/// Call `finalize` to finish the computation, once per thread, if there was no error sending results earlier.
|
||||
///
|
||||
/// * if `thread_limit` is `Some`, the given amount of threads will be used. If `None`, all logical cores will be used.
|
||||
/// * `new_thread_state(thread_number) -> State` produces thread-local state once per thread to be based to `consume`
|
||||
/// * if `thread_limit` is `Some`, then the given number of threads will be used. If `None`, all logical cores will be used.
|
||||
/// * `new_thread_state(thread_number) -> State` produces thread-local state once per thread to be passed to `consume`
|
||||
/// * `consume(Item, &mut State) -> Output` produces an output given an input obtained by `input` along with mutable state initially
|
||||
/// created by `new_thread_state(…)`.
|
||||
/// * `finalize(State) -> Output` is called to potentially process remaining work that was placed in `State`.
|
||||
|
@@ -232,7 +232,7 @@ pub trait Reduce {
|
||||
///
|
||||
/// If an `Error` is returned, the entire operation will be stopped.
|
||||
fn feed(&mut self, item: Self::Input) -> Result<Self::FeedProduce, Self::Error>;
|
||||
/// Called once once all items where passed to `feed()`, producing the final `Output` of the operation or an `Error`.
|
||||
/// Called once for all items that were passed to `feed()`, producing the final `Output` of the operation or an `Error`.
|
||||
fn finalize(self) -> Result<Self::Output, Self::Error>;
|
||||
}
|
||||
|
||||
|
@@ -116,12 +116,12 @@ mod not_parallel {
|
||||
pub use not_parallel::{build_thread, in_parallel_with_slice, join, threads, Scope};
|
||||
|
||||
/// Read items from `input` and `consume` them in a single thread, producing an output to be collected by a `reducer`,
|
||||
/// whose task is to aggregate these outputs into the final result returned by this function.
|
||||
/// whose task it is to aggregate these outputs into the final result returned by this function.
|
||||
///
|
||||
/// * `new_thread_state(thread_number) -> State` produces thread-local state once per thread to be based to `consume`
|
||||
/// * `new_thread_state(thread_number) -> State` produces thread-local state once per thread to be passed to `consume`
|
||||
/// * `consume(Item, &mut State) -> Output` produces an output given an input along with mutable state.
|
||||
/// * For `reducer`, see the [`Reduce`] trait
|
||||
/// * if `thread_limit` has no effect as everything is run on the main thread, but is present to keep the signature
|
||||
/// * `thread_limit` has no effect as everything is run on the main thread, but is present to keep the signature
|
||||
/// similar to the parallel version.
|
||||
///
|
||||
/// **This serial version performing all calculations on the current thread.**
|
||||
@@ -143,12 +143,12 @@ where
|
||||
}
|
||||
|
||||
/// Read items from `input` and `consume` them in multiple threads,
|
||||
/// whose output output is collected by a `reducer`. Its task is to
|
||||
/// whose output is collected by a `reducer`. Its task is to
|
||||
/// aggregate these outputs into the final result returned by this function with the benefit of not having to be thread-safe.
|
||||
/// Caall `finalize` to finish the computation, once per thread, if there was no error sending results earlier.
|
||||
/// Call `finalize` to finish the computation, once per thread, if there was no error sending results earlier.
|
||||
///
|
||||
/// * if `thread_limit` is `Some`, the given amount of threads will be used. If `None`, all logical cores will be used.
|
||||
/// * `new_thread_state(thread_number) -> State` produces thread-local state once per thread to be based to `consume`
|
||||
/// * if `thread_limit` is `Some`, the given number of threads will be used. If `None`, all logical cores will be used.
|
||||
/// * `new_thread_state(thread_number) -> State` produces thread-local state once per thread to be passed to `consume`
|
||||
/// * `consume(Item, &mut State) -> Output` produces an output given an input obtained by `input` along with mutable state initially
|
||||
/// created by `new_thread_state(…)`.
|
||||
/// * `finalize(State) -> Output` is called to potentially process remaining work that was placed in `State`.
|
||||
|
@@ -72,14 +72,14 @@ impl State {
|
||||
/// Each call to this method will cause the corresponding filter to be invoked unless `driver` indicates a `process` filter,
|
||||
/// which is only launched once and maintained using this state.
|
||||
///
|
||||
/// Note that it's not an error if there is no filter process for `operation` or if a long-running process doesn't supported
|
||||
/// Note that it's not an error if there is no filter process for `operation` or if a long-running process doesn't support
|
||||
/// the desired capability.
|
||||
///
|
||||
/// ### Deviation
|
||||
///
|
||||
/// If a long running process returns the 'abort' status after receiving the data, it will be removed similar to how `git` does it.
|
||||
/// However, it delivers an unsuccessful error status later, it will not be removed, but reports the error only.
|
||||
/// If any other non-'error' status is received, the process will be stopped. But that doesn't happen if if such a status is received
|
||||
/// If a long running process returns the 'abort' status after receiving the data, it will be removed similarly to how `git` does it.
|
||||
/// However, if it returns an unsuccessful error status later, it will not be removed, but reports the error only.
|
||||
/// If any other non-'error' status is received, the process will be stopped. But that doesn't happen if such a status is received
|
||||
/// after reading the filtered result.
|
||||
pub fn apply<'a>(
|
||||
&'a mut self,
|
||||
|
@@ -96,7 +96,7 @@ pub mod io_err {
|
||||
}
|
||||
|
||||
#[cfg(not(unix))]
|
||||
/// Returns whether a a file has the executable permission set.
|
||||
/// Returns whether a file has the executable permission set.
|
||||
pub fn is_executable(_metadata: &std::fs::Metadata) -> bool {
|
||||
false
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ impl hash::Hash for oid {
|
||||
}
|
||||
}
|
||||
|
||||
/// A utility able to format itself with the given amount of characters in hex.
|
||||
/// A utility able to format itself with the given number of characters in hex.
|
||||
#[derive(PartialEq, Eq, Hash, Ord, PartialOrd)]
|
||||
pub struct HexDisplay<'a> {
|
||||
inner: &'a oid,
|
||||
|
@@ -75,7 +75,7 @@ impl<'a> MessageRef<'a> {
|
||||
summary(self.title)
|
||||
}
|
||||
|
||||
/// Further parse the body into into non-trailer and trailers, which can be iterated from the returned [`BodyRef`].
|
||||
/// Further parse the body into non-trailer and trailers, which can be iterated from the returned [`BodyRef`].
|
||||
pub fn body(&self) -> Option<BodyRef<'a>> {
|
||||
self.body.map(|b| BodyRef::from_bytes(b))
|
||||
}
|
||||
|
8
gix-pack/src/cache/delta/traverse/mod.rs
vendored
8
gix-pack/src/cache/delta/traverse/mod.rs
vendored
@@ -53,8 +53,8 @@ pub struct Context<'a> {
|
||||
pub entry_end: u64,
|
||||
/// The decompressed object itself, ready to be decoded.
|
||||
pub decompressed: &'a [u8],
|
||||
/// The depth at which this object resides in the delta-tree. It represents the amount of base objects, with 0 indicating
|
||||
/// an 'undeltified' object, and higher values indicating delta objects with the given amount of bases.
|
||||
/// The depth at which this object resides in the delta-tree. It represents the number of base objects, with 0 indicating
|
||||
/// an 'undeltified' object, and higher values indicating delta objects with the given number of bases.
|
||||
pub level: u16,
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ pub struct Options<'a, 's> {
|
||||
pub object_progress: Box<dyn DynNestedProgress>,
|
||||
/// is a progress instance to track the overall progress.
|
||||
pub size_progress: &'s mut dyn Progress,
|
||||
/// If `Some`, only use the given amount of threads. Otherwise, the amount of threads to use will be selected based on
|
||||
/// the amount of available logical cores.
|
||||
/// If `Some`, only use the given number of threads. Otherwise, the number of threads to use will be selected based on
|
||||
/// the number of available logical cores.
|
||||
pub thread_limit: Option<usize>,
|
||||
/// Abort the operation if the value is `true`.
|
||||
pub should_interrupt: &'a AtomicBool,
|
||||
|
@@ -14,7 +14,7 @@ pub struct Entry {
|
||||
/// when resolving thin packs.
|
||||
/// Depends on `CompressionMode` when the iterator is initialized.
|
||||
pub compressed: Option<Vec<u8>>,
|
||||
/// The amount of bytes the compressed portion of the entry takes, i.e. the portion behind behind the header.
|
||||
/// The amount of bytes the compressed portion of the entry takes, i.e. the portion behind the header.
|
||||
pub compressed_size: u64,
|
||||
/// The CRC32 over the complete entry, that is encoded header and compressed object data.
|
||||
/// Depends on `CompressionMode` when the iterator is initialized
|
||||
|
@@ -14,14 +14,14 @@ pub use types::{Error, ObjectExpansion, Options, Outcome};
|
||||
mod tree;
|
||||
|
||||
/// Generate [`Count`][output::Count]s from input `objects` with object expansion based on [`options`][Options]
|
||||
/// to learn which objects would would constitute a pack. This step is required to know exactly how many objects would
|
||||
/// be in a pack while keeping data around to avoid minimize object database access.
|
||||
/// to learn which objects would constitute a pack. This step is required to know exactly how many objects would
|
||||
/// be in a pack while keeping data around to minimize database object access.
|
||||
///
|
||||
/// A [`Count`][output::Count] object maintains enough state to greatly accelerate future access of packed objects.
|
||||
///
|
||||
/// * `db` - the object store to use for accessing objects.
|
||||
/// * `objects_ids`
|
||||
/// * A list of objects ids to add to the pack. Duplication checks are performed so no object is ever added to a pack twice.
|
||||
/// * A list of objects IDs to add to the pack. Duplication checks are performed so no object is ever added to a pack twice.
|
||||
/// * Objects may be expanded based on the provided [`options`][Options]
|
||||
/// * `objects`
|
||||
/// * count the amount of objects we encounter
|
||||
|
@@ -23,8 +23,8 @@ pub use types::{Algorithm, ProgressId, SafetyCheck, Statistics};
|
||||
pub struct Options<F> {
|
||||
/// The algorithm to employ.
|
||||
pub traversal: Algorithm,
|
||||
/// If `Some`, only use the given amount of threads. Otherwise, the amount of threads to use will be selected based on
|
||||
/// the amount of available logical cores.
|
||||
/// If `Some`, only use the given number of threads. Otherwise, the number of threads to use will be selected based on
|
||||
/// the number of available logical cores.
|
||||
pub thread_limit: Option<usize>,
|
||||
/// The kinds of safety checks to perform.
|
||||
pub check: SafetyCheck,
|
||||
|
@@ -8,7 +8,7 @@ pub struct Statistics {
|
||||
pub average: crate::data::decode::entry::Outcome,
|
||||
/// A mapping of the length of the chain to the amount of objects at that length.
|
||||
///
|
||||
/// A length of 0 indicates full objects, and everything above that involves the given amount
|
||||
/// A length of 0 indicates full objects, and everything more than that uses the given number
|
||||
/// of delta objects.
|
||||
pub objects_per_chain_length: BTreeMap<u32, u32>,
|
||||
/// The amount of bytes in all compressed streams, one per entry
|
||||
|
@@ -11,8 +11,8 @@ use crate::{
|
||||
/// Traversal options for [`traverse_with_index()`][index::File::traverse_with_index()]
|
||||
#[derive(Default)]
|
||||
pub struct Options {
|
||||
/// If `Some`, only use the given amount of threads. Otherwise, the amount of threads to use will be selected based on
|
||||
/// the amount of available logical cores.
|
||||
/// If `Some`, only use the given number of threads. Otherwise, the number of threads to use will be selected based on
|
||||
/// the number of available logical cores.
|
||||
pub thread_limit: Option<usize>,
|
||||
/// The kinds of safety checks to perform.
|
||||
pub check: crate::index::traverse::SafetyCheck,
|
||||
|
@@ -15,8 +15,8 @@ use crate::{
|
||||
|
||||
/// Traversal options for [`index::File::traverse_with_lookup()`]
|
||||
pub struct Options<F> {
|
||||
/// If `Some`, only use the given amount of threads. Otherwise, the amount of threads to use will be selected based on
|
||||
/// the amount of available logical cores.
|
||||
/// If `Some`, only use the given number of threads. Otherwise, the number of threads to use will be selected based on
|
||||
/// the number of available logical cores.
|
||||
pub thread_limit: Option<usize>,
|
||||
/// The kinds of safety checks to perform.
|
||||
pub check: index::traverse::SafetyCheck,
|
||||
|
@@ -148,7 +148,7 @@ pub mod lookup {
|
||||
/// The id uniquely identifying the oid lookup table.
|
||||
pub const ID: gix_chunk::Id = *b"OIDL";
|
||||
|
||||
/// Return the amount of bytes needed to store the data on disk for the given amount of `entries`
|
||||
/// Return the number of bytes needed to store the data on disk for the given amount of `entries`
|
||||
pub fn storage_size(entries: usize, object_hash: gix_hash::Kind) -> u64 {
|
||||
(entries * object_hash.len_in_bytes()) as u64
|
||||
}
|
||||
@@ -267,7 +267,7 @@ pub mod large_offsets {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Return the amount of bytes needed to store the given amount of `large_offsets`
|
||||
/// Return the number of bytes needed to store the given amount of `large_offsets`
|
||||
pub(crate) fn storage_size(large_offsets: usize) -> u64 {
|
||||
8 * large_offsets as u64
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ pub struct Context<'a, T> {
|
||||
///
|
||||
/// This could be read from the `gitoxide.userAgent` configuration variable.
|
||||
pub user_agent: (&'static str, Option<std::borrow::Cow<'static, str>>),
|
||||
/// If `true`, output all packetlines using the the `gix-trace` machinery.
|
||||
/// If `true`, output all packetlines using the `gix-trace` machinery.
|
||||
pub trace_packetlines: bool,
|
||||
}
|
||||
|
||||
|
@@ -138,7 +138,7 @@ static REGISTRY: Lazy<HashMap<usize, Option<ForksafeTempfile>>> = Lazy::new(|| {
|
||||
pub enum ContainingDirectory {
|
||||
/// Assume the directory for the tempfile exists and cause failure if it doesn't
|
||||
Exists,
|
||||
/// Create the directory recursively with the given amount of retries in a way that is somewhat race resistant
|
||||
/// Create the directory recursively with the given number of retries in a way that is somewhat race resistant
|
||||
/// depending on the amount of retries.
|
||||
CreateAllRaceProof(create_dir::Retries),
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ pub trait Transport: TransportWithoutIO {
|
||||
/// `extra_parameters` are interpreted as `key=value` pairs if the second parameter is `Some` or as `key`
|
||||
/// if it is None.
|
||||
///
|
||||
/// Returns the service capabilities according according to the actual [Protocol] it supports,
|
||||
/// Returns the service capabilities according to the actual [Protocol] it supports,
|
||||
/// and possibly a list of refs to be obtained.
|
||||
/// This means that asking for an unsupported protocol might result in a protocol downgrade to the given one
|
||||
/// if [TransportWithoutIO::supported_protocol_versions()] includes it or is empty.
|
||||
|
@@ -28,7 +28,7 @@ pub trait Transport: TransportWithoutIO {
|
||||
/// `extra_parameters` are interpreted as `key=value` pairs if the second parameter is `Some` or as `key`
|
||||
/// if it is None.
|
||||
///
|
||||
/// Returns the service capabilities according according to the actual [Protocol] it supports,
|
||||
/// Returns the service capabilities according to the actual [Protocol] it supports,
|
||||
/// and possibly a list of refs to be obtained.
|
||||
/// This means that asking for an unsupported protocol might result in a protocol downgrade to the given one
|
||||
/// if [`TransportWithoutIO::supported_protocol_versions()`] includes it.
|
||||
|
@@ -202,7 +202,7 @@ pub mod describe {
|
||||
self
|
||||
}
|
||||
|
||||
/// Only consider the given amount of candidates, instead of the default of 10.
|
||||
/// Only consider the given number of candidates, instead of the default of 10.
|
||||
pub fn max_candidates(mut self, candidates: usize) -> Self {
|
||||
self.max_candidates = candidates;
|
||||
self
|
||||
|
@@ -605,7 +605,7 @@ pub mod fetch {
|
||||
#[clap(long, help_heading = Some("SHALLOW"), conflicts_with_all = ["shallow_since", "shallow_exclude", "deepen", "unshallow"])]
|
||||
pub depth: Option<NonZeroU32>,
|
||||
|
||||
/// Extend the current shallow boundary by the given amount of commits, with 0 meaning no change.
|
||||
/// Extend the current shallow boundary by the given number of commits, with 0 meaning no change.
|
||||
#[clap(long, help_heading = Some("SHALLOW"), value_name = "DEPTH", conflicts_with_all = ["depth", "shallow_since", "shallow_exclude", "unshallow"])]
|
||||
pub deepen: Option<u32>,
|
||||
|
||||
|
@@ -13,7 +13,7 @@ pub struct Args {
|
||||
/// Bring up a terminal user interface displaying progress visually.
|
||||
#[clap(long, conflicts_with("quiet"))]
|
||||
pub progress: bool,
|
||||
/// The amount of threads to use. If unset, use all cores, if 0 use al physical cores.
|
||||
/// The number of threads to use. If unset, use all cores, if 0 use all physical cores.
|
||||
#[clap(short = 't', long)]
|
||||
pub threads: Option<usize>,
|
||||
|
||||
|
Reference in New Issue
Block a user