56 Commits
Author SHA1 Message Date
Fintan Halpenny 8c5df5ecbd release: radicle-surf, radicle-git-ext, git-ref-format 2026-06-22 11:42:52 +01:00
Lorenz Leutgeb c92d2898a8 git-ext, surf: Use git2::ObjectFormat 2026-06-22 11:31:07 +01:00
Lorenz Leutgeb 8efd733c20 git-ext/test: Remove unused file 2026-06-22 11:31:07 +01:00
Fintan Halpenny 7fa4c57352 git-ref-format/macro: Use proc-macro-error3 over proc-macro-error2
`proc-macro-error2` is now unmaintained[^0].
Use `proc-macro-error3` as the new drop-in replacement.

[^0]: https://rustsec.org/advisories/RUSTSEC-2026-0173
2026-06-22 11:31:07 +01:00
Lorenz Leutgeb 354fa416f9 git2: 0.20 → 0.21 2026-05-21 09:14:47 +01:00
Fintan Halpenny 1042ea3546 git-ext: Update to 0.12.0 2026-02-18 16:42:36 +00:00
Fintan Halpenny 925138577f git2: Update to 0.20 2026-02-18 16:20:16 +00:00
Fintan Halpenny f5ba6821bd Release Crates
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`.
2025-12-08 15:11:21 +00:00
Fintan Halpenny 10333caec7 clippy: use io::Error::other
Use the helper constructor to build I/O errors with the `Other` kind.
2025-12-08 15:11:21 +00:00
Fintan Halpenny 68d6fa879f clippy: explicit lifetimes
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
2025-12-08 15:11:21 +00:00
Fintan Halpenny abcb05a2bd cargo: apply MSRV 1.78.0
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.
2025-12-08 15:11:21 +00:00
Fintan Halpenny b570fa1435 Re-License to "MIT OR Aapache-2.0"
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
2025-11-14 12:52:22 +01:00
Fintan Halpenny 6aa5d631d3 meta: CHANGELOG entries for release 2025-09-11 09:07:17 +01:00
Fintan Halpenny 6422fd580b Crates Release
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`
2025-09-11 09:05:28 +01:00
Lorenz Leutgeb 24237552ec ref-format: Relax first component of namespaced
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.
2025-09-09 13:17:29 +02:00
Fintan Halpenny 30d8275e5f surf: avoid last commit computation on Tree
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.
2025-07-15 17:19:35 +01:00
Fintan Halpenny 40a87a2d6b chore: bump release numbers
- `radicle-std-ext-0.1.1`
- `git-ref-format-0.4.0`
- `git-ref-format-core-0.4.0`
- `git-ref-format-macro-0.4.0`
- `radicle-git-ext-0.9.0`
- `radicle-surf-0.23.0`
2025-02-20 08:42:04 +00:00
Fintan Halpenny c265df5b8e chore: update Cargo metadata
Update `edition` fields to 2021.

Add `homepage` and `repository` fields to all the sub-crates.
2025-02-20 08:42:04 +00:00
Fintan Halpenny 527fddfd4d chore: update rust toolchain 1.84
Fixed clippy warnings for lifetime elision and preferring `Display`
implementations over `ToString`.
2025-02-10 14:11:28 +00:00
Fintan Halpenny 41e3f30ffc chore: update deny and audit
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
2025-02-10 14:11:28 +00:00
Fintan Halpenny d1cc777cfb ref-format: improve Qualified/NamespacedPattern API
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
2024-09-02 13:16:38 +01:00
Fintan Halpenny 9d3af5fa43 meta: update dependency versions
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-08-29 09:54:11 +01:00
Fintan Halpenny 556663854e release: radicle-surf-0.22.0, radicle-git-ext-0.8.0
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-07-18 09:34:06 +01:00
Fintan Halpenny 224ad08366 Update to git2-0.19
Update the `git2` dependencies to `0.19`, which also allows the uncommenting of
two tests in the `diff` test suite -- as reported by [issue #149][#149].

[#149]: https://github.com/radicle-dev/radicle-git/issues/149

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-06-28 12:08:44 +01:00
Alexis Sellier 19353fc700 git: Split parsing of Time from Author
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
2024-04-25 15:28:16 +01:00
Fintan Halpenny b4ca7f31db test: improve commit and submodule testing
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
2024-03-13 14:22:10 +00:00
Fintan Halpenny f4a958010c fmt: remove .rustfmt.toml
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
2024-03-13 14:11:36 +00:00
Fintan Halpenny e0b8789b47 git-ext, surf: update git2-0.18.1
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
2023-12-04 10:57:39 +00:00
Fintan Halpenny 045a2d6534 publish: radicle-git-ext, git-ref-format-*, radicle-surf
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-06-02 13:40:33 +01:00
Fintan Halpenny 9bc0d118a0 publish: radicle-git-ext-0.5.1, radicle-surf-0.12.1
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
2023-05-31 13:57:36 +01:00
Fintan Halpenny 6309dea70d publish: radicle-git-ext 0.5.0
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
2023-05-10 08:59:30 +01:00
xphoniex 98a6e69379 git-ext: Display/parse timezone offset in the format git2 expects.
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>
2023-05-09 22:27:25 +01:00
Fintan Halpenny 0897f918e6 radicle-git-ext: feature flag minicbor
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
2023-05-08 12:47:51 +01:00
Fintan Halpenny 4c9e958dd7 publish: radicle-git-ext, git-ref-format, radicle-surf
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
2023-05-05 10:37:50 +01:00
Fintan Halpenny fc6a4fcac5 publish: git-ref-format, radicle-git-ext, radicle-surf
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
2023-05-05 10:11:13 +01:00
Fintan Halpenny 64fef2f0ad git-ref-format: add Refspec type
Add a Refspec type that represents a `[+]<src>:<dst>` refspec[[0]].

[0]: https://git-scm.com/book/en/v2/Git-Internals-The-Refspec

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-05-05 09:50:53 +01:00
Fintan Halpenny 24e27f6e87 commit: use read_header
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
2023-05-04 17:27:47 +01:00
Fintan Halpenny 956bf070d4 trailers: add Token constructor
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
2023-05-04 11:54:21 +01:00
Fintan Halpenny 15014923c7 publish: git-ref-format-{core, macro}, radicle-git-ext, radicle-surf
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
2023-05-03 20:45:06 +01:00
Fintan Halpenny 9d44dacdae publish: radicle-git-ext and radicle-surf
Publish new versions:
* radicle-git-ext 0.4.0
* radicle-surf 0.10.0

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-05-03 20:06:40 +01:00
Fintan Halpenny a8ce42766f meta: update to git2-0.17.0
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
2023-04-14 17:07:35 +01:00
Fintan Halpenny e81ea9b558 git-ext: update to version 0.3.0
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
2023-03-27 11:01:21 +01:00
Fintan Halpenny 5c1ae05420 git-ext: check commit's metadata fields
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
2023-03-09 12:50:39 +00:00
Han Xu 59515f68e8 move git-ref-format to under radicle-git-ext
Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-02-21 20:19:30 -08:00
Han Xu c844605121 radicle-git-ext: merge in git-commit
Removed `mod references` and its uses in `radicle-macros` and
`radicle-git-types` crates.

Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-02-19 18:43:55 -08:00
Fintan Halpenny 18c4f53421 Merge remote-tracking branch 'origin/radicle-git-ext-bump-version'
* origin/radicle-git-ext-bump-version:
  bump up version for radicle-git-ext

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2023-02-08 16:27:57 +00:00
Han Xu ac9cfc1cc6 git-ref-format: bump up version and add CHANGELOG.md
Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-02-07 04:11:16 -08:00
Han Xu 0f985a8bf6 bump up version for radicle-git-ext
Also added CHANGELOG.md file.

Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-02-07 02:38:05 -08:00
Fintan Halpenny 7036923712 nix: update to rust-1.67
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
2023-01-30 11:00:22 +00:00
Fintan Halpenny 0728ee1f66 radicle-git-ext: remove multihash and minicbor
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
2022-11-04 12:25:02 +00:00