#git #in-memory #protocol

packfile

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

2 releases

0.1.1 Jul 4, 2023
0.1.0 Oct 22, 2022

#541 in Development tools

Download history 26/week @ 2023-08-15 4/week @ 2023-08-22 6/week @ 2023-08-29 30/week @ 2023-09-05 15/week @ 2023-09-12 8/week @ 2023-09-19 7/week @ 2023-09-26 23/week @ 2023-10-03 14/week @ 2023-10-10 16/week @ 2023-10-17 28/week @ 2023-10-24 11/week @ 2023-10-31 136/week @ 2023-11-07 120/week @ 2023-11-14 24/week @ 2023-11-21 126/week @ 2023-11-28

408 downloads per month

WTFPL license

34KB
697 lines

Packfile Crate API

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
~117K SLoC