cli: Add diff parsing

Parse Git's unified diff format into Radicle Surf's types.  Support to
and from the format helps testing and debugging.

Split the UnifiedDiff trait into Decode and Encode traits so we
can offer Decode in cases where no data could be expected..
For example Option<Hunk<_>> and Hunk<_> allowing partial and repeated
decoding on a byte stream.

Avoid decoding `Diff`, `DiffContent::Binary`, `FileDiff`, and `FileHeader`
types.  `Diff` keeps fields and methods private which are necessary for
decoding.
This commit is contained in:
Slack Coder
2023-09-19 15:18:50 +02:00
committed by cloudhead
parent b337e1b1cb
commit cb78f144be
3 changed files with 380 additions and 44 deletions
+34
View File
@@ -0,0 +1,34 @@
diff --git a/README.md b/README.md
index 18fb832..ce60f40 100644
--- a/README.md
+++ b/README.md
@@ -4,8 +4,8 @@ componentwise
reusing
simplest
crag
-offended
omitting
+offended
grinders
cutting
proverb
@@ -21,8 +21,8 @@ alliterative
stays
mahogany
whole
-snowflake
ellipses
+snowflake
yearning
inciting
permeating
@@ -30,3 +30,9 @@ bereaved
eventfully
hears
vacationing
+
+imprisoning
+absinthe
+shack
+exhale
+perfected