This adds the ability to the git-remote-helper to open and update
patches via a `git push` to the magic ref `refs/patches` and
`refs/heads/patches/<patch-id>`.
The main change is that we had to move away from offering the `connect`
capability in the remote helper, to offering `push` and `fetch`
individually.
To get a feel for how this works, see the `rad-patch-via-push.md`
example.
If the 'rad' remote is still in the git config, then some of the CLI
tooling will think the project exists -- even after running `rad rm`.
For example, in the current state, if `rad rm` is followed by `rad
init` then the operation will fail.
During `rad rm`, attempt to delete the 'rad' remote.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Previously, `rad rm` would require the node to be running to untrack
the repository.
This is no longer necessary since the tracking db is exposed via the
`radicle` crate. Instead, use the db directly to untrack the RID
during `rad rm`, as long as the node is not already running.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Now logic for parsing and supporting user facing Patch messages is
shared for creation and editing, refactor and move supporting code to
terminal::patch.
This fixes a bug where the title may be incorrectly parsed, resulting in
it containing multiple lines.
Avoid having ssh-agent a hard dependency of `rad-auth`.
Only add the user's key in `auth::init()` to ssh-agent if it is running,
instead of exiting with error.
For `auth::authenticate()` which is used to authenticate the user with
Radicle, assume using `RAD_PASSPHRASE` is a fallback authentication
method. If ssh-agent is not-detected, verify the RAD_PASSPHRASE is
present and correct. Treat neither being present as an error.
Support this by clarifying on `ssh::agent::connect()`s error which are
due to it not being present.
Trying to open or update Patch will fail if the user's working copy is
out of sync with the Radicle projects canonical head.
Fix this by always operating on the storage when opening or
updating a patch.
It wasn't being set correctly, and it's not the place for it,
so we remove it and set it in `httpd`.
Note that `Remote` is now simply a wrapper around `SignedRefs`.
If we want to remove the type or turn it into an alias, it will
require touching lots of different parts of the codebase. I opted
not to do that here as it's lower priority.
When tracking a repository with the `--fetch` option, we run a fetch
once the tracking is done.
When tracking nodes, we don't accept the `--fetch` flag, as there may
not be a repository to fetch.
This commit fixes the inconsistency with the `rad patch` command,
which previously displayed an empty table when there were no issues. Now,
the CLI will display a message indicating that there are no issues to display.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Instead of `Node::announce_refs`, we call `rad sync` to have the
terminal block while waiting for nodes to fetch the changes.
We also change the use of `git push` in the patch command to not
trigger syncing in that case.
This command announces refs to peers and waits for them to be
in sync.
Adds a subscribe method to `Handle` so that we can get the events
from the seed to allow us to confirm that the configured seeds fetched
from us.
Implementing the `rad remote rm` command in order to be able
to remote a remote inside the radicle remote list.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Implementing the `rad remote list` command in order to be able to
list all the radicle remotes added to the repository
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
implementing the `rad remote add` command in order
to be able to add rad remotes from the command
line.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This commits introduces just a couple of helper functions in order
to work with the `rad remote *` commands.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
A repository may fail to load when trying to run `rad ls`, but the
failure will be hidden from the output.
Add a `--verbose` flag to add warning information to stdout when a
repository fails to load.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Add a `rad fork` command to create a forked namespace, using the local
peer, for the given repository.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
A project may exist within storage without the local operator not
having a fork of the project.
Use Doc::canonical in rad inspect to retrieve the canonical identity
document for use during inspection.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett