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 [manual page](man:gitnamespaces(7)) says:
> Git supports dividing the refs of a single repository into
> multiple namespaces, each of which has its own branches,
> tags, and `HEAD`.
Here, the mention of `HEAD` implies that requiring all
namespaced to start with
refs/namespaces/*/refs
is too strict, as there are legal namespaced refs such as
refs/namespaces/*/HEAD
which are not captured. Relax the corresponding condition, change
documentation and add a test to avoid regression.
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
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
This allows us to parse time values on their own.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
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
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
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-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
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
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
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
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
Multihash was deemed as not needed for compatibility since it is
possible to detect a change from SHA1 to SHA256 based on their encoded
lengths. The YAGNI principle is executed and multihash (and minicbor
while we're here) are removed.
This also had an effect on `Urn` which relied heavily on encoding the
value using multihash. The `urn` and `namespace` modules were removed
from radicle-git-types, since they were likely not going to be used
anyway.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett