radicle-heartwood-lfs/crates
Lorenz Leutgeb b7cfcfff75
workspace: A Little Less `git2`
Make `git2` an *optional* dependency of `radicle-cob`, and refactor
`radicle` to depend on crates that in turn do not depend on `git2`
*non-optionally*

The main offending dependency of `radicle-cob` is `radicle-git-ext`
from the `radicle-git` workspace in repository
(rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt) which *non-optionally* depends on
`git2`.

So, to achieve removal of this dependency:

 1. The crate is refactored to depend on the new crates
    `radicle-git-ref-format` `radicle-git-metadata`, and
    `radicle-oid` introduced in the previous commits, instead of
    `radicle-git-ext`.
 2. Some code from the `radicle-git-ext` crate in the `radicle-git`
    workspace in repository (rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt) is
    copied. See `crates/radicle-cob/src/backend/git/commit.rs`.

This cascades to `radicle` and its dependents.

  Firstly, the there is an
`impl Deref<Target=git2::Oid> for radicle_git_ext::Oid`. This made
it very convenient to just deref to obtain the wrapped `git2::Oid`,
so there are many expressions of the shape `*oid` in `radicle` and
its dependents. However `radicle-oid` does not provide
`impl Deref<Target=git2::Oid> for radicle_oid::Oid`, as notably,
`Target` is an associated type, and not a type parameter, so an
implementation of `Deref` would tie the new `Oid` too tightly to a
particular implementation.
Instead, work with `impl From<radicle_oid::Oid> for git2::Oid`
(which can be enabled using the feature flag `radicle-oid/git2`).
This explains the changes from `*oid` to `oid.into()` at every
transition to "`git2` land".

  Secondly, `radicle` and its dependents are refactored to also depend
on `radicle-git-ref-format` and (much less prominently)
`radicle-git-metadata` instead of `radicle-git-ext`
This is to avoid pulling in `git2` via these dependencies.

  Thirdly, as the re-exports in `crates/radicle/src/git.rs` change,
they are at the same time also cleaned up. Notably, the types from
`radicle-git-ref-format` are re-exported under `fmt` only, not "twice".

While overall this obviously is very much a breaking change, these
changes should mostly amount to changing from `Deref` to `Into`, i.e.,
`*oid` → `oid.into()` and rewriting imports for `radicle::git::fmt`.
This is indicated by the mostly mechanical nature of the changes to
`crates/radicle-{cli,node,remote-helper}`.
2025-10-13 16:14:23 +02:00
..
radicle workspace: A Little Less `git2` 2025-10-13 16:14:23 +02:00
radicle-cli workspace: A Little Less `git2` 2025-10-13 16:14:23 +02:00
radicle-cli-test radicle-cli-test: Prepare testing with `jj` 2025-09-26 12:03:01 +01:00
radicle-cob workspace: A Little Less `git2` 2025-10-13 16:14:23 +02:00
radicle-crypto oid: New crate 2025-10-13 15:00:12 +02:00
radicle-dag repo: Move workspace crates into `crates` subdirectory 2025-06-09 15:09:21 +02:00
radicle-fetch workspace: A Little Less `git2` 2025-10-13 16:14:23 +02:00
radicle-git-metadata git-metadata: New crate extract from `radicle-git` 2025-10-13 16:07:39 +02:00
radicle-git-ref-format git-ref-format: New crate 2025-10-13 13:34:15 +02:00
radicle-node workspace: A Little Less `git2` 2025-10-13 16:14:23 +02:00
radicle-oid oid: New crate 2025-10-13 15:00:12 +02:00
radicle-protocol workspace: A Little Less `git2` 2025-10-13 16:14:23 +02:00
radicle-remote-helper workspace: A Little Less `git2` 2025-10-13 16:14:23 +02:00
radicle-schemars crates: bump for release 2025-10-06 16:36:30 +01:00
radicle-signals signals: Guard most of the crate for Unix 2025-08-22 15:19:31 +01:00
radicle-ssh release: prepare crates 2025-08-12 12:13:49 +02:00
radicle-systemd systemd: Support Credentials 2025-10-09 10:03:21 +01:00
radicle-term crates: bump for release 2025-10-06 16:36:30 +01:00