#git #in-memory #protocols #utilities #high-level #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

#372 in Development tools

Download history 26/week @ 2024-01-26 1/week @ 2024-02-02 50/week @ 2024-02-09 65/week @ 2024-02-16 331/week @ 2024-02-23 88/week @ 2024-03-01 13/week @ 2024-03-08 15/week @ 2024-03-15 17/week @ 2024-03-22 81/week @ 2024-03-29 39/week @ 2024-04-05 116/week @ 2024-04-12 107/week @ 2024-04-19 81/week @ 2024-04-26 12/week @ 2024-05-03

323 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–7MB
~119K SLoC