The previous implementation of Display for Time is shown as absolute
minutes, whereas git expects HH:MM format.
The FromStr implementation for Author also did not correctly convert
+/-HHMM to absolute minutes.
Signed-off-by: xphoniex <xphoniex@users.noreply.github.com>
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Hide the minicbor feature of git-ref-format behind a minicbor feature
flag in radicle-git-ext.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
git-ref-format-core included the required changes and was missed via
the last publish. Publish the set of crates bumped up to a new semver.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Publish git-ref-format, radicle-git-ext, and radicle-surf with several
additions and bug fixes.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The `Odb::reader` method states:
Note that most backends do not support streaming reads because
they store their objects as compressed/delta’ed blobs. If the
backend does not support streaming reads, use the read method
instead.
This can lead to objects not being found when verifying for
commits. Instead use `read_header` to determine the `ObjectType` of
the `Oid`.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
During the reorganisation of the codebase, the constructors for Token
were removed.
Add back a constructor via the `TryFrom<&'a str>` trait.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
In an attempt to publish radicle-surf, it could not compile due to
git-ref-format supposedly missing.
This is an attempt to publish the git-ref-format family and
radicle-git-ext again in order to try publish radicle-surf.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Adds several methods to Line:
* as_bytes -- gets the underlying bytes
* from_utf8 -- convert the Line to a String
* from_utf8_lossy -- convert Line to Cow<str>
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Updates all crates to the latest git2 version, 0.17.0.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Move git-commit, git-trailers, and link-git to an archived directory
to hide them away -- showing the intent that radicle-git-ext will be
the main crate for git functionality.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Update radicle-git-ext to version 0.3.0 for publishing to crates.io.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The `Oid`s passed into `Commit::new` for parents and tree are never
verified to be commits or a tree, respectively.
Upon `write` of the commit, read the object using the ODB to determine
its type. If its the incorrect object then function fails without
writing to the ODB.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
A vulnerability in a transitive dependency, remove_dir_all, used by
tempfile was found[0].
Update tempfile to 3.4, which does not depend on remove_dir_all.
[0]: https://rustsec.org/advisories/RUSTSEC-2023-0018
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The git-trailers crate depends on parsing logic using nom. This is a
heavy dependency for something that can be done using git2.
Remove the dependency of git-trailers in git-commit and localise the
trailer types -- using git2 to parse the trailers out of the git
commit message.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Improve on the previous iteration of `Blob`.
`BlobVec` is simply a `Vec<u8>` underneath, so it is technically not
needed and can be replaced by using `Vec<u8>` directly.
Notice that BlobRef can implement AsRef and Deref for `[u8]`. This
leads to being able to use `T: AsRef<[u8]>` for `Blob` methods and the
`Serialize` implementation.
Apply these two facts and remove any of the remaining code that is no
longer needed.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
* han/rm-blob-content:
change BlobContent to BlobRef that borrows its content from git2::Blob
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Rust 1.67 was announced[0].
Update the nix sources to be on par with the latest rustc version.
This required fixes to clippy warnings for using variable
interpolation for format strings.
There was also an advisory error related to libgit2-sys[1], which is
transitively depended on via git2. The fix is included in the 0.16.1
version of git2.
[0]: https://blog.rust-lang.org/2023/01/26/Rust-1.67.0.html
[1]: https://rustsec.org/advisories/RUSTSEC-2023-0003
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The motivation is to avoid copying the content bytes that could be
potentially quite large.
Also support Blob<BlobRef>::to_owned() just in case.
Signed-off-by: Han Xu <keepsimple@gmail.com>