From a23606b91c833fc79d45ba4c5a8777850eaf8b38 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 22 Oct 2022 14:49:16 +0100 Subject: [PATCH] Add README --- README.md | 16 ++++++++++++++++ src/lib.rs | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..579663e --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +`packfile` is a simple library providing utilities to generate [Git Packfiles] in memory. + +Usage: +```rust +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 +``` + +[Git Packfiles]: https://git-scm.com/book/en/v2/Git-Internals-Packfiles diff --git a/src/lib.rs b/src/lib.rs index 3ec4e32..4c4b38d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,9 +12,11 @@ //! 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 //! ``` //! +//! The generated packfile can then be encoded within a [`SidebandData`] to send the data to a +//! client +//! //! [Git Packfiles]: https://git-scm.com/book/en/v2/Git-Internals-Packfiles //! [`SidebandData`]: crate::codec::Codec::SidebandData -- libgit2 1.7.2