#git #protocols #in-memory #low-level

packfile

A simple library providing utilities to generate Git Packfiles in memory and send them to clients

3 releases

0.1.2 Feb 23, 2024
0.1.1 Jul 4, 2023
0.1.0 Oct 22, 2022

#934 in Development tools

Download history 4/week @ 2024-11-16 10/week @ 2024-11-23 10/week @ 2024-11-30 6/week @ 2024-12-07 1/week @ 2024-12-14 14/week @ 2024-12-28 46/week @ 2025-01-04 20/week @ 2025-01-11 11/week @ 2025-01-18 1/week @ 2025-01-25 5/week @ 2025-02-01 7/week @ 2025-02-08 8/week @ 2025-02-15 25/week @ 2025-02-22 34/week @ 2025-03-01

75 downloads per month

WTFPL license

45KB
982 lines

Packfile Crate API codecov

packfile is a simple library providing utilities to generate Git Packfiles in memory.

Usage:

use packfile::{high_level::GitRepository, low_level::PackFile};

let mut repo = GitRepository::default();
repo.insert(&["path", "to"], "file.txt", "hello world!".into()).unwrap();
let (_commit_hash, entries) =
    repo.commit("Linus Torvalds", "torvalds@example.com", "Some commit message").unwrap();

let _packfile = PackFile::new(&entries);
// ... packfile can then be encoded within a SidebandData to send the data to a client

lib.rs:

packfile is a simple library providing utilities to generate Git Packfiles in memory.

Usage:

#
let mut repo = GitRepository::default();
repo.insert(&["path", "to"], "file.txt", "hello world!".into()).unwrap();
let (_commit_hash, entries) =
    repo.commit("Linus Torvalds", "torvalds@example.com", "Some commit message").unwrap();

let _packfile = PackFile::new(&entries);

The generated packfile can then be encoded within a SidebandData to send the data to a client

Dependencies

~5–12MB
~125K SLoC