Commit Graph

2492 Commits

Author SHA1 Message Date
Lorenz Leutgeb 3fb04623a4
cli/warning: Add `fn deprecate`
A helper to print deprecation warnings to stderr.
2025-09-17 10:31:25 +02:00
Lorenz Leutgeb 2635562c92
cli/node/status: Add `--only nid` 2025-09-17 10:31:21 +02:00
Fintan Halpenny 8afd55ff6f build: update release files location
The destination of the release files was moved, so this patch updates that
location.
2025-09-16 21:25:57 +02:00
Erik Kundt d2e10fdef6 cli/tests/commands: Clean up test `rad_patch`
This removes the `rad issue` test examples from being used in the
`fn rad_patch` test example execution. Removing it here is fine, since
it is being executed on its own anyways.
2025-09-16 19:40:35 +02:00
Sebastian Martinez 19210faab8 protocol/service: Change `Routing table updated..` from info to debug 2025-09-16 13:38:26 +01:00
Lorenz Leutgeb 86472fdccb
remote-helper/fetch: Improve error handling 2025-09-16 11:51:08 +02:00
Lorenz Leutgeb f542df1833
radicle: Use `git fetch-pack` for "local fetch" 2025-09-16 11:51:08 +02:00
Lorenz Leutgeb 20663a4e39
remote-helper: Use `git send-pack` for "internal push" 2025-09-16 11:44:56 +02:00
Lorenz Leutgeb f9ff484c9e cli: Make `rad patch show` prettier
The output of this command is confusing. It is not clear which of the
hashes printed is that of the revision and which one is the respective
head commit.

Further, the hash is omitted on the initial revision, adding confusion.

Further, the terminology of "revised" vs. "updated" is confusing.

This rewrites `timeline.rs` to drop the distinction between various
revisions (in wording, the small icon is still different) and cleans up
the output.

Attention is paid to alignment of the output. Now all verbs of updates
("accepted", "rejected", "reviewed", "merged") are aligned, and authors
("… by …") are also aligned.

The rewrite itself is not for better code quality or readability.
Note that all the code in this file only accessed via one `fn` by one
callsite in the implementation of `rad patch`.
2025-09-16 11:37:13 +02:00
Lorenz Leutgeb 43246fe6c8 remote-helper: Parse base revision early
Translation of the string passed as the value for push-option base
happens delayed.

Change this by parsing as soon as the value is written.

This also decreases the dependency fingerprint on `radicle-cli`.
2025-09-15 16:28:02 +01:00
Lorenz Leutgeb ef27961866
remote-helper: List `HEAD`
Report the default branch correctly via the symbolic reference `HEAD`.
2025-09-15 17:10:29 +02:00
Erik Kundt 101fbff809 ci: Deny `cargo doc` warnings
A job should fail whenever `rust doc` emits warnings.
2025-09-15 12:23:11 +02:00
Fintan Halpenny 14fcf50677 docs: fix doc string linking 2025-09-15 10:34:42 +01:00
Lorenz Leutgeb ee9e6de5f3 remote-helper: Do not assume remote name
Avoid ending up with an upstream to a potentially non-existent remote
when pushing to an anonymous remote.
2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 6b9ff4f99e cli/init: Allow `--setup-signing` with bare repos
The `--setup-signing` flag is a no-op when combined with `--existing`
and errors on bare repositories.

Make it effective in combination with `--existing` and also rewrite it
to support bare repositories, gracefully falling back to just avoid
writing to `.gitsigners`.
2025-09-15 10:21:09 +01:00
Lorenz Leutgeb fd93240b9d cli/git: Remove dead code `fn view_diff` 2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 86ea33b0ca cli/clone: Add flag `--bare` 2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 766e281d39 radicle: Allow creating bare clones 2025-09-15 10:21:09 +01:00
Lorenz Leutgeb e528c40a07 radicle-cli: Test initializing from bare repos 2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 606882f01f remote-helper: Simplify handling of `GIT_DIR`
The contract for Git remote handlers says that we can expect
`GIT_DIR` to be set, and this also simplifies logic regarding
bare vs. non-bare repositories.
2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 354565c579 radicle: Handle `GIT_DIR` more uniformly
Pull specification of the working directory into `radicle::git::run`,
to unify how higher level wrappers pass it down.
2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 4e67467966 remote-helper: Refactor option handling
Group `["option", "progress", ..]`, and `["option", ..]` cases together during
match.

Make the key/value matching cleaner using `ok_or_else` and then matching on the
key value.
2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 876d22b072 remote-helper: Remove unused push error variant 2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 550fcccc27 remote-helper: Do not hard-code binary name 2025-09-15 10:21:09 +01:00
Lorenz Leutgeb 897404164b remote-helper: Make crate binary-only
This crate is not a library, i.e., it is not intended to be depended
upon by other crates. Rather, it implements the `git-remote-rad`
binary.

Reflect this by moving `lib.rs` to `main.rs`, merging it with
`git-remote-rad.rs`.
2025-09-15 10:21:09 +01:00
Fintan Halpenny 66adbffd61 term: Use static template in spinner initialization
Use `static` + `LazyLock` to ensure that the templates evaluation only
happens once and the value can be re-used on each subsequent access.
2025-09-15 11:17:35 +02:00
Erik Kundt 8fc37e3316 term: Move to indicatif spinner
This fixes line flodding on narrow terminals and a missing cursor after
cancelation by replacing the custom spinner with an indicatif spinner.
2025-09-15 11:17:35 +02:00
Erik Kundt ee9ecfda76 remote-helper: Remove `SyncWriter` in favor of `PaintTarget` 2025-09-15 11:17:35 +02:00
Erik Kundt 153a8f9fbe node: Remove `SyncWriter` in favor of `PaintTarget` 2025-09-15 11:17:35 +02:00
Erik Kundt 11a109ef41 term: Introduce `PaintTarget`
This introduces a `PaintTarget`, that defines the stream an operation
uses to draw to (`stdout`, `stderr`, `sink`). It will be used in
subsequent commits to configure the new spinner.
2025-09-15 11:17:35 +02:00
Lorenz Leutgeb 379037956a remote-helper: Prevent doubly verifying each push
The context of the invocation of `git push` "internally" by the
remote helper is the same as by the user invoking `git push` most
of the time. That is, these pushes run within the same repository,
thus the configuration for pre-push hooks applies to both. This
leads to every push being verified *twice*.

If the user intends to configure pre-push hooks, then they would
do that on the remote with URL `rad://…`, and so the hook would
be executed before `git-remote-rad` even gets called.

We thus specify `--no-verify` to not verify again.
2025-09-11 16:59:12 +01:00
Lorenz Leutgeb a0f6cbf5f1 radicle: Move interpretation of output to binary
`radicle::git::run` interprets the `Output` returned by the `git`
process. However, depending on the application we have different
requirements for interpreting the output, e.g., how to handle errors.

Make `radicle::git::run` not interpret `Output`, but move this
logic to the respective binary crates (`radicle-remote-helper` and
`radicle-cli`).
2025-09-11 16:59:12 +01:00
Lorenz Leutgeb 0a8317c35f remote-helper: Interpret verbosity option
The `verbosity` option is ignored, which makes it more difficult to
obtain debugging information if the "internal" push, i.e., the
`git push` invocation by `git-remote-rad` fails.

Provide two types for verbosity, and wire them up.
2025-09-11 16:59:12 +01:00
Fintan Halpenny 11e8b89b20 radicle/src/git: additionally specify pruneTags for remote
Ensure that, when adding a remote, `pruneTags` is set to `false` so
that tags are not pruned when fetching from a remote's namespace.
2025-09-11 11:25:34 +01:00
Matthias Beyer 646d4360e7 cli/node: Replace manual pushing with Table::extend()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:29:47 +02:00
Matthias Beyer 2f28232676 cli/issue: Replace manual pushing with Table::extend()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:29:36 +02:00
Matthias Beyer 8554e996b8 cli/diff: Replace manual pushing with Table::extend()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:28:53 +02:00
Matthias Beyer fbef60eed6 cli/sync: Replace manual pushing with Table::extend()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:27:59 +02:00
Matthias Beyer 370ae3643a cli/patch: Replace manual iterator partitioning with Itertools::partition_result()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:23:40 +02:00
Matthias Beyer 3f489354b6 cli: Add itertools dependency
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:23:30 +02:00
Matthias Beyer 9c2f97abe1 cli/remote: Replace manual building table from iterator
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:23:30 +02:00
Matthias Beyer 4bd45cdabd cli/inbox: Replace manual building table from iterator
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:23:30 +02:00
Matthias Beyer 016cab1dbf term/table: Add Table::with_opts() to set options after Table obj was constructed
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:23:30 +02:00
Matthias Beyer fb458537b4 cli/patch: Replace manual building table from iterator
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:23:30 +02:00
Matthias Beyer 41a742ed9b term/table: Add impl FromIterator for Table
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-10 21:23:28 +02:00
Matthias Beyer ff021d5889 cli: Rewrite `#[path="…"]` module declarations
Rewrite module declarations that use the `#[path="…"]` annotation
to the more idomatic `pub mod …` + `pub use …` forms.

For the "self" module, that is not possible because `self` is an
identifier in Rust, and also `r#self` is not admissable as a raw
identifier, so stick to `rad_self`.

Files in submodules were patched as appropriate.
2025-09-10 21:09:29 +02:00
Matthias Beyer 11fc98c9c9
term: Replace manual Extend impl for Table
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2025-09-07 12:39:32 +02:00
Lorenz Leutgeb f00d1d6743 cli/self: Stop printing information about the node
To get to a point of separating the users' identity from the node, then the `rad
self` command should not display information related to the node so prominently.

The relation between `rad` and `radicle-node` is really similar to that between
`rad` and SSH Agent. They communicate via socket. So, when this connection is
successful, it is printed, but not more.

There may be some re-learning for users here, but it is worth the improvement.

Note that the information being removed here is available via `rad node status`
(see previous commit).
2025-09-04 17:12:19 +03:00
Lorenz Leutgeb e1af550a09 cli/node: Print Node ID
If we ever want to disentangle the users' identity from the node, then
the `rad node` commands must learn to print the information related to
the node, so here we go.
2025-09-04 17:12:19 +03:00
Lorenz Leutgeb 9b7529baa7 hooks: Filter for "radicle.{xyz,zulipchat.com}"
This hook should make people think before committing domain names
like "radicle.xyz" and "radicle.zulipchat.com" to our Rust code.

Note that these checks can be easily skipped as follows:

    SKIP=grep-radicle.xyz,grep-radicle.zulipchat.com git commit …

See also <https://pre-commit.com/#temporarily-disabling-hooks>
2025-09-04 16:44:05 +03:00