#git #in-memory #protocol #packfile

packfile

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

1 unstable release

Uses new Rust 2021

0.1.0 Oct 22, 2022

#637 in Development tools

Download history 48/week @ 2022-10-17 16/week @ 2022-10-24 31/week @ 2022-10-31 17/week @ 2022-11-07 10/week @ 2022-11-14

86 downloads per month

WTFPL license

30KB
608 lines

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:

# 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);

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

Dependencies

~5.5MB
~91K SLoC