Run `cargo update -p proptest` to get the latest compatible version of
`proptest`.
This is to allow `cargo deny` to pass, since the previous version of
`proptest` brought in a vulnerable version of `rand`.
Bump the release of the crates to reflect the changes in the licensing.
Note that there are no change in the semantics of the libraries, as
checked via `cargo-semverchecks`.
With Rust 1.89.0, there was introduction to the mismatched lifetime
syntax lint[^1].
The suggestion is to use implicit lifetimes via `<'_>`, however, to
maintain the MSRV, the lifetimes are made explicit here by introducing
an (or using the existing) `'a` lifetime.
[^1]: https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#mismatched-lifetime-syntaxes-lint
Find and apply the MSRV, `rust-version = "1.78.0"` to the
`radicle-git` crates.
While applying this change, use the workspace values to clean up
repetition.
The main dependant of `radicle-git`, and its crates, is [`heartwood`].
It is licensed under MIT or Apache-2.0, which has been incompatible with the GPL-3.0 license.
Since the intellectual property of this code base is with the Better Internet Foundation, it was
decided to re-license code in this repository to make the upstream repository compatible.
- Remove the license headers (and instructions to add them)
- Add MIT and Apache-2.0 licenses
- Remove the GPL-3.0 license
- Change the license declarations in the `Cargo.toml` files
[`heartwood`]: https://app.radicle.xyz/nodes/seed.radicle.xyz/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Updating `radicle-git-ref-core` with update to `Namespaced` logic,
releasing the crate at version `0.5.0`.
This requires bumps to:
- `radicle-git-ref-macro-0.5.0`
- `radicle-git-ext-0.10.0`
- `radicle-surf-0.25.0`
The computation for getting the last commit that touched a `Tree` can be
expensive. This is avoided when constructing the `Tree` and is moved to a method
on the `Tree` and `Entry`, aptly named `last_commit`.
`Tree::commit` is kept, however, it now refers to the `Commit` that was used
when constructing the `Tree`. This is required to calculate the last commit. It
was also necessary to add the path of the `Tree`.
For adding `Entry::last_commit`, it was necessary to add the path of the
`Entry`. Incidentally, this can be useful for consumers, since just the `name`
would mean that they would have to manually construct the full path.
The deny tooling removed many of the keys that were in the `deny.toml`.
The auditing of the repository reported that `proc-macro-error` is
unmaintained ([RUSTSEC-2024-0370]). This is replaced with the fork, `proc-macro-error2`,
which is a drop-in replacement.
It also produced a vulnerability report ([RUSTSEC-2024-0421]) for the
`idna` crate, a transitive dependency of `url`. This is fixed by
pinning `url` to `>= 2.5.4`
[RUSTSEC-2024-0370]: https://rustsec.org/advisories/RUSTSEC-2024-0370
[RUSTSEC-2024-0421]: https://rustsec.org/advisories/RUSTSEC-2024-0421
It also pins `url` to be `>= 2.5.4`, since
The `base64` dependency is only required with the `serde`
feature. Move the import of `Engine` into the implentation sites.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Some elements of the `QaulifiedPattern` and `NamespacedPattern` API
were missing:
- `From` implementations
- `Display` implementations
- `Serialize` and `Deserialize` implementations
- `qualified_pattern` macro
This also requires bumping versions:
- `git-ref-format`: 0.3.1
- `git-ref-core`: 0.3.1
- `git-ref-format-macro`: 0.3.1
- `radicle-git-ext`: 0.8.1
- `radicle-surf`: 0.22.1
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The formatting no longer needs nightly and only uses stable features.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Add the Nix flake machinery for developing using Nix tooling.
This requires that the following are added:
- Cargo.lock
- rust-toolchain
To ensure that versions are pinned.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Two of the tests in radicle-git-ext and radicle-surf relied on using
the Git repository itself. This can end up being an issue when
sandboxing is involved.
This improves the situation by being able to generate commit data to
add to a temporary repository.
It also adds a helper for creating a local, temporary submodule for
testing the submodule interactions in the radicle-surf API.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The formatting configuration is not worth the maintenance of a nightly
version. Remove it and allow the default formatting to be used
instead.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Removing the Nix tooling managed by niv in favour of a future
`flake.nix`.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Git [submodules] are encoded as commits when walking a Git tree. To
allow the support of them in `radicle-surf`, the tree entry is checked
for this case. The entry will be treated such that it is has a name,
prefix, Oid, and the submodule's URL.
It's important to note that the Oid is not usable within the context
of the repository that is being browsed, since they are entirely
separate.
Instead, the URL should be used in conjunction with the Oid for
browsing purposes outside of `radicle-surf`. However, in a future
iteration it may be considered to be able to browse the local contents
of the submodule, if possible.
N.b. getting the submodule and its URL is not supported for a bare
repository, since it will complain about not having a working tree.
[submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Run `niv update` to get the latest Rust toolchain.
This required applying some clippy improvements:
- Removing unnecessary re-export of Oid in `stats` module.
- Replace `get(0)` with `first`
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Update git2 version to 0.18.1 and provide an updated release version
of radicle-git-ext 0.7.0 and radicle-surf 0.18.0.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The current `blob` function is limited to always associating a Blob
with a Commit.
Expose `BlobRef` through a `blob_ref` method, and add useful methods
and serialization to it.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
* sebastinez/add-small-disclaimer-on-diff-commits-fn:
surf: Add a small explainer on binary detection in diffs
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
* sebastinez/add-current-oid-to-filediff:
surf: Add `DiffFile`s to `FileDiff` variants without a diff
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
In some cases a moved file can also be modified and in these cases
there will be a diff as well as new Oid's for the two sides of the
diff.
Add DiffFile to the Moved type, changing the insert_moved method to
accept the DiffFile's and the DiffContent.
When serializing a Moved, if the old and the new are the same then the
serialization of the diff files and content are skipped -- same as the
old behaviour. Otherwise, the two sides are serialized along with the
content.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Update the toolchain to rust-1.72.0. This brought with it a new clippy
check for needless '#'s for string literals. However, this is a false
positive and is being tracked here[[0]].
[0]: https://github.com/rust-lang/rust-clippy/issues/11402
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The homepage and repository fields were out of date. Update them to
the new radicle-git link.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Add features to radicle-git-ext to access the bstr and
percent-encoding features of git-ref-format.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Publish radicle-surf, updating radicle-git-ext and allowing a minicbor
feature flag.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Publish radicle-git-ext to include the following changes:
* Hiding minicbor behind a feature flag
* Fix to commit author's time display/parse
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
* origin/dave/fix-author-timestamp:
git-ext: Display/parse timezone offset in the format git2 expects.
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