Unified · Split
| @@ -503,6 +503,7 @@ where · 502 unmodified lines | ||
| 503 | 503 | { |
| 504 | 504 | use git_repository::prelude::FindExt; |
| 505 | 505 | let bytes = std::sync::atomic::AtomicU64::default(); |
| 506 | + #[allow(deprecated)] | |
| 506 | 507 | let odb = Arc::new(git_repository::odb::linked::Store::at(objects_dir)?); |
| 507 | 508 | |
| 508 | 509 | git_repository::parallel::in_parallel( |
| @@ -17,7 +17,7 @@ pub mod existing { · 16 unmodified lines | ||
| 17 | 17 | pub mod existing_object { |
| 18 | 18 | use git_hash::ObjectId; |
| 19 | 19 | |
| 20 | − /// The error returned by the various [`find_*`][crate::FindExt::find_commit()] trait methods. | |
| 20 | + /// The error returned by the various [`find_*()`][crate::FindExt::find_commit()] trait methods. | |
| 21 | 21 | #[derive(Debug, thiserror::Error)] |
| 22 | 22 | #[allow(missing_docs)] |
| 23 | 23 | pub enum Error<T: std::error::Error + 'static> { |
| @@ -36,7 +36,7 @@ pub mod existing_object { · 12 unmodified lines | ||
| 36 | 36 | pub mod existing_iter { |
| 37 | 37 | use git_hash::ObjectId; |
| 38 | 38 | |
| 39 | − /// The error returned by the various [`find_*`][crate::FindExt::find_commit()] trait methods. | |
| 39 | + /// The error returned by the various [`find_*_iter()`][crate::FindExt::find_commit_iter()] trait methods. | |
| 40 | 40 | #[derive(Debug, thiserror::Error)] |
| 41 | 41 | #[allow(missing_docs)] |
| 42 | 42 | pub enum Error<T: std::error::Error + 'static> { |
| @@ -48,18 +48,3 @@ pub mod existing_iter { · 5 unmodified lines | ||
| 48 | 48 | ObjectKind { expected: git_object::Kind }, |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | − | |
| 52 | −/// An Entry in a pack providing access to its data. | |
| 53 | −/// | |
| 54 | −/// Its commonly retrieved by reading from a pack index file followed by a read from a pack data file. | |
| 55 | −#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)] | |
| 56 | −#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] | |
| 57 | −#[allow(missing_docs)] | |
| 58 | −pub struct Entry<'a> { | |
| 59 | − /// The pack-data encoded bytes of the pack data entry as present in the pack file, including the header followed by compressed data. | |
| 60 | − pub data: &'a [u8], | |
| 61 | − /// The crc32 hash over the entirety of `data`, or None if the pack file format doesn't support it yet. | |
| 62 | − pub crc32: Option<u32>, | |
| 63 | − /// The version of the pack file containing `data` | |
| 64 | − pub version: crate::pack::data::Version, | |
| 65 | −} | |
| @@ -1,20 +1,15 @@ | ||
| 1 | 1 | #![deny(missing_docs, unsafe_code, rust_2018_idioms)] |
| 2 | 2 | |
| 3 | −//! Git stores all of its data as _Objects_, which ata along with a hash over all data. Thus it's an | |
| 4 | −//! object store indexed by data with inherent deduplication: the same data will have the same hash, and thus occupy the same | |
| 5 | −//! space within the store. | |
| 3 | +//! Git stores all of its data as _Objects_, which are data along with a hash over all data. Thus it's an | |
| 4 | +//! object store indexed by the signature of data itself with inherent deduplication: the same data will have the same hash, | |
| 5 | +//! and thus occupy the same space within the store. | |
| 6 | 6 | //! |
| 7 | −//! There are various flavours of object stores, all of which supporting iteration, reading and possibly writing. | |
| 7 | +//! There is only one all-round object store, also known as the [`Store`], as it supports ~~everything~~ most of what git has to offer. | |
| 8 | 8 | //! |
| 9 | −//! * [`loose::Store`] | |
| 10 | −//! * A database storing one object per file, named by its hash, using zlib compression. | |
| 11 | −//! * O(1) reads and writes, bound by IO operations per second | |
| 12 | −//! * [`compound::Store`] | |
| 13 | −//! * A database using a [`loose::Store`] for writes and multiple [`pack::Bundle`]s for object reading. It can also refer to multiple | |
| 14 | −//! additional [`compound::Store`] instances using git-alternates. | |
| 15 | −//! * This is the database closely resembling the object database in a git repository, and probably what most people would want to use. | |
| 16 | −//! * [`linked::Store`] | |
| 17 | −//! * A database containing various [`compound::Stores`][compound::Store] as gathered from `alternates` files. | |
| 9 | +//! * loose object reading and writing | |
| 10 | +//! * access to packed objects | |
| 11 | +//! * multiple loose objects and pack locations as gathered from `alternates` files. | |
| 12 | +#![allow(deprecated)] // TODO: actually remove the deprecated items and remove thos allow | |
| 18 | 13 | use std::path::PathBuf; |
| 19 | 14 | use std::sync::Arc; |
| 20 | 15 | |
| @@ -28,13 +23,13 @@ pub mod alternate; · 7 unmodified lines | ||
| 28 | 23 | |
| 29 | 24 | /// A thread-local handle to access any object. |
| 30 | 25 | pub type Handle = Cache<general::Handle<OwnShared<general::Store>>>; |
| 31 | −/// A thread-local handle to access any object, but thread-safe and independent of the actual type of OwnShared. | |
| 26 | +/// A thread-local handle to access any object, but thread-safe and independent of the actual type of `OwnShared` or feature toggles in `git-features`. | |
| 32 | 27 | pub type HandleArc = Cache<general::Handle<Arc<general::Store>>>; |
| 33 | 28 | |
| 34 | 29 | /// A thread-safe store for creation of handles. |
| 35 | 30 | pub type Store = general::Store; |
| 36 | 31 | |
| 37 | −/// Create a new cached odb handle. | |
| 32 | +/// Create a new cached odb handle with support for additional options. | |
| 38 | 33 | pub fn at_opts(objects_dir: impl Into<PathBuf>, slots: general::init::Slots) -> std::io::Result<Handle> { |
| 39 | 34 | let handle = |
| 40 | 35 | OwnShared::new(general::Store::at_opts(objects_dir, slots)?).to_handle(RefreshMode::AfterAllIndicesLoaded); |
| @@ -7,8 +7,10 @@ pub mod find; · 6 unmodified lines | ||
| 7 | 7 | pub mod init; |
| 8 | 8 | mod write; |
| 9 | 9 | |
| 10 | −/// An object database with tiered lookup packs and loose objects. | |
| 10 | +/// A static object database with tiered lookup in packs and loose objects. | |
| 11 | 11 | /// This is a typical git database as used in git repositories, sans 'alternates'. |
| 12 | +/// Note that this ODB won't detect changes on disk and will eagerly map all relevant files. Multipack indices are not supported either. | |
| 13 | +#[deprecated(since = "0.27", note = "superseded by git_odb::Store")] | |
| 12 | 14 | pub struct Store { |
| 13 | 15 | /// A loose object database into which new objects are written |
| 14 | 16 | pub loose: loose::Store, |
| @@ -6,6 +6,7 @@ use crate::store::compound; · 5 unmodified lines | ||
| 6 | 6 | /// It does not contain any objects itself. |
| 7 | 7 | /// |
| 8 | 8 | /// Furthermore, it won't handle multi-pack indices and might be removed at some point in the future to allow focussing on a single database. |
| 9 | +#[deprecated(since = "0.27", note = "superseded by git_odb::Store")] | |
| 9 | 10 | pub struct Store { |
| 10 | 11 | /// The compound databases containing the actual objects. |
| 11 | 12 | pub dbs: Vec<compound::Store>, |