Expand description
Git-Internal: a high-performance Rust library for Git objects and pack files—encode/decode, delta (ref/offset/zstd), caching, streaming, and sync/async pipelines.
Goals
- Provide high-performance parsing and generation of Git pack format and Git objects.
- Support both file-based and streaming inputs of Git Pack.
- Offer synchronous and asynchronous APIs for multi-threaded and Tokio runtimes.
Core Capabilities
- Decoding: base objects and delta objects (Ref-Delta, Offset-Delta, ZstdDelta).
- Encoding: serial and parallel pipelines; offset deltas and Zstd-based deltas.
- Streaming:
decode_streamforStream<Bytes>;decode_asyncdecodes in a new thread and sends entries. - Caching & memory: LRU-based cache;
MemSizeRecordertracks heap usage; optionalmem_limitto bound memory. - Utilities: SHA1, zlib, delta, zstdelta toolkits.
Modules
internal::pack: decode/encode, caches, waitlists, parallel pipelines, helpers.internal::object: Blob/Tree/Commit/Tag/Note objects, type enum, object trait.internal::zlib: compression/decompression stream utilities.deltaandzstdelta: delta algorithms and rebuild helpers.errors: unified error types.hash: SHA1 helpers.utils: common utilities (e.g.,CountingReader).
Typical Usage
- Offline large-file decode:
Pack::decode_async(reader, sender)decodes in a thread and sendsEntrys. - Stream decode:
Pack::decode_stream(stream, sender)consumesReaderStreamunder Tokio. - Parallel encode:
encode_async/parallel_encodebuild packs from many objects.
Test Data
- Located under
tests/data/, includes real pack files and object sets.
Re-exports§
pub use protocol::AuthenticationService;pub use protocol::GitProtocol;pub use protocol::ProtocolError;pub use protocol::RepositoryAccess;pub use protocol::ServiceType;
Modules§
- errors
- Error types for the Git-Internal crate.
- hash
- In Git, the SHA-1 hash algorithm is widely used to generate unique identifiers for Git objects. Each Git object corresponds to a unique SHA-1 hash value, which is used to identify the object’s location in the Git internal and mega database.
- internal
- protocol
- utils
Macros§
- time_it
- Count the time taken to execute a block of code.