🏡 index : ~doyle/packfile.git

author Jordan Doyle <jordan@doyle.la> 2022-10-22 13:49:16.0 +00:00:00
committer Jordan Doyle <jordan@doyle.la> 2022-10-22 13:49:16.0 +00:00:00
commit
a23606b91c833fc79d45ba4c5a8777850eaf8b38 [patch]
tree
09f7b7e63fd745f531a8b1b89f1b468051b1f9b6
parent
85a1dd96c94028d9ddcb9d129c97b55bed8f79f9
download
a23606b91c833fc79d45ba4c5a8777850eaf8b38.tar.gz

Add README



Diff

 README.md  | 16 ++++++++++++++++
 src/lib.rs |  4 +++-
 2 files changed, 19 insertions(+), 1 deletion(-)

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