chore: remove radicle-tools

The `radicle-tools` binaries were specialised binaries for early development of
the `heartwood` set of crates. Choose to remove the crate so that it no longer
needs to build as part of our workspace.
This commit is contained in:
Fintan Halpenny 2025-06-20 16:43:11 +02:00 committed by Lorenz Leutgeb
parent 42285e71cf
commit d8d00666d3
9 changed files with 0 additions and 352 deletions

11
Cargo.lock generated
View File

@ -2645,17 +2645,6 @@ dependencies = [
"zeroize",
]
[[package]]
name = "radicle-tools"
version = "0.9.0"
dependencies = [
"anyhow",
"radicle",
"radicle-cli",
"radicle-git-ext",
"radicle-term",
]
[[package]]
name = "rand"
version = "0.8.5"

View File

@ -1,44 +0,0 @@
[package]
name = "radicle-tools"
license.workspace = true
version = "0.9.0"
authors = ["Alexis Sellier <alexis@radicle.xyz>"]
edition.workspace = true
rust-version.workspace = true
[[bin]]
name = "rad-init"
path = "src/rad-init.rs"
[[bin]]
name = "rad-self"
path = "src/rad-self.rs"
[[bin]]
name = "rad-merge"
path = "src/rad-merge.rs"
[[bin]]
name = "rad-set-canonical-refs"
path = "src/rad-set-canonical-refs.rs"
[[bin]]
name = "rad-push"
path = "src/rad-push.rs"
[[bin]]
name = "rad-agent"
path = "src/rad-agent.rs"
[[bin]]
name = "rad-cli-demo"
path = "src/rad-cli-demo.rs"
[dependencies]
anyhow = { workspace = true }
radicle = { workspace = true }
radicle-cli = { workspace = true }
# N.b. this is required to use macros, even though it's re-exported
# through radicle
radicle-git-ext = { workspace = true, features = ["serde"] }
radicle-term = { workspace = true }

View File

@ -1,60 +0,0 @@
use anyhow::{anyhow, Context as _};
use radicle::{crypto, crypto::ssh};
use std::io::prelude::*;
use std::{env, io};
fn main() -> anyhow::Result<()> {
let profile = radicle::Profile::load()?;
let mut agent = ssh::agent::Agent::connect()?;
println!("key: {}", ssh::fmt::key(profile.id()));
println!("hash: {}", ssh::fmt::fingerprint(profile.id()));
match env::args().nth(1).as_deref() {
Some("add") => {
print!("passphrase: ");
io::stdout().flush()?;
let mut passphrase = String::new();
io::stdin().lock().read_line(&mut passphrase)?;
let passphrase = passphrase.trim().to_owned().into();
let secret = profile
.keystore
.secret_key(Some(passphrase))?
.ok_or_else(|| anyhow!("Key not found in {:?}", profile.keystore.path()))?;
agent.register(&secret)?;
println!("ok");
}
Some("remove") => {
agent.unregister(profile.id())?;
println!("ok");
}
Some("remove-all") => {
agent.unregister_all()?;
println!("ok");
}
Some("sign") => {
let mut stdin = Vec::new();
io::stdin().read_to_end(&mut stdin)?;
let sig = agent.sign(profile.id(), &stdin).context("Signing failed")?;
let sig = crypto::Signature::from(sig);
println!("{}", &sig);
}
Some(other) => {
anyhow::bail!("Unknown command `{}`", other);
}
None => {
if agent.signer(profile.public_key).is_ready()? {
println!("ready: yes");
} else {
println!("ready: no");
}
}
}
Ok(())
}

View File

@ -1,88 +0,0 @@
use std::{thread, time};
use radicle_cli::terminal;
fn main() -> anyhow::Result<()> {
let demo = terminal::io::select(
"Choose something to try out:",
&[
"confirm",
"pager",
"spinner",
"spinner-drop",
"spinner-error",
"editor",
"prompt",
],
"Choose wisely!",
)?;
match *demo {
"confirm" => {
if terminal::confirm("Would you like to proceed?") {
terminal::success!("You said 'yes'");
}
}
"pager" => {
let mut table = radicle_term::Table::<1, radicle_term::Label>::new(
radicle_term::TableOptions::bordered(),
);
let rows = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/rad-cli-demo.rs"));
for row in rows.lines() {
table.push([row.into()]);
}
radicle_term::pager::page(table)?;
}
"editor" => {
let output = terminal::editor::Editor::comment()
.extension("rs")
.initial("// Enter code here.")?
.edit();
match output {
Ok(Some(s)) => {
terminal::info!("You entered:");
terminal::blob(s);
}
Ok(None) => {
terminal::info!("You didn't enter anything.");
}
Err(e) => {
return Err(e.into());
}
}
}
"spinner" => {
let mut spinner = terminal::spinner("Spinning turbines..");
thread::sleep(time::Duration::from_secs(1));
spinner.message("Still spinning..");
thread::sleep(time::Duration::from_secs(1));
spinner.message("Almost done..");
thread::sleep(time::Duration::from_secs(1));
spinner.message("Done.");
spinner.finish();
}
"spinner-drop" => {
let _spinner = terminal::spinner("Spinning turbines..");
thread::sleep(time::Duration::from_secs(3));
}
"spinner-error" => {
let spinner = terminal::spinner("Spinning turbines..");
thread::sleep(time::Duration::from_secs(3));
spinner.error("broken turbine");
}
"prompt" => {
let fruit = terminal::io::select(
"Enter your favorite fruit:",
&["apple", "pear", "banana", "strawberry"],
"Choose wisely!",
)?;
terminal::success!("You have chosen '{fruit}'");
}
_ => {}
}
Ok(())
}

View File

@ -1,24 +0,0 @@
use std::path::Path;
use radicle::{git, identity::Visibility, Profile};
fn main() -> anyhow::Result<()> {
let cwd = Path::new(".").canonicalize()?;
let name = cwd.file_name().unwrap().to_string_lossy().to_string();
let repo = radicle::git::raw::Repository::open(cwd)?;
let profile = Profile::load()?;
let signer = profile.signer()?;
let (id, _, _) = radicle::rad::init(
&repo,
name.try_into()?,
"",
git::refname!("master"),
Visibility::default(),
&signer,
&profile.storage,
)?;
println!("ok: {id}");
Ok(())
}

View File

@ -1,65 +0,0 @@
use std::collections::HashSet;
use std::env;
use anyhow::{anyhow, bail};
use radicle::cob::patch::{PatchId, RevisionId};
use radicle::git::Oid;
use radicle::storage::ReadStorage;
use radicle_cli::terminal as term;
fn main() -> anyhow::Result<()> {
let args = env::args().skip(1).collect::<Vec<_>>();
let (pid, rev) = match args.as_slice() {
[pid, rev] => {
let pid: PatchId = pid.parse()?;
let rev: Oid = rev.parse()?;
(pid, Some(RevisionId::from(rev)))
}
[pid] => {
let pid: PatchId = pid.parse()?;
(pid, None)
}
_ => bail!("usage: rad-merge <patch-id> [<revision-id>]"),
};
let profile = radicle::Profile::load()?;
let (working, rid) = radicle::rad::cwd()?;
let stored = profile.storage.repository(rid)?;
let mut patches = profile.patches_mut(&stored)?;
let mut patch = patches.get_mut(&pid)?;
if patch.is_merged() {
anyhow::bail!("fatal: patch {pid} is already merged");
}
let (revision, r) = if let Some(id) = rev {
let r = patch
.revision(&id)
.ok_or_else(|| anyhow!("revision {id} not found"))?;
(id, r)
} else {
patch.latest()
};
let head = r.head();
let mut revwalk = stored.backend.revwalk()?;
revwalk.push_head()?;
let commits = revwalk
.map(|r| r.map(Oid::from))
.collect::<Result<HashSet<Oid>, _>>()?;
if !commits.contains(&head) {
anyhow::bail!("fatal: patch head {head} is not in default branch");
}
let signer = term::signer(&profile)?;
patch
.merge(revision, head, &signer)?
.cleanup(&working, &signer)?;
println!("✓ Patch {pid} merged at commit {head}");
println!("You may now run `rad sync --announce`.");
Ok(())
}

View File

@ -1,28 +0,0 @@
use std::path::Path;
use radicle::{
node::Handle,
storage::{ReadStorage, SignRepository, WriteRepository},
};
fn main() -> anyhow::Result<()> {
let cwd = Path::new(".").canonicalize()?;
let repo = radicle::git::raw::Repository::open(&cwd)?;
let profile = radicle::Profile::load()?;
let (_, id) = radicle::rad::remote(&repo)?;
let output = radicle::git::run::<_, _, &str, &str>(&cwd, ["push", "rad"], None)?;
println!("{output}");
let signer = profile.signer()?;
let project = profile.storage.repository(id)?;
let sigrefs = project.sign_refs(&signer)?;
let head = project.set_head()?;
radicle::Node::new(profile.socket()).announce_refs(id)?;
println!("head: {}", head.new);
println!("ok: {}", sigrefs.signature);
Ok(())
}

View File

@ -1,13 +0,0 @@
fn main() -> anyhow::Result<()> {
let profile = radicle::Profile::load()?;
println!("id: {}", profile.id());
println!("key: {}", radicle::crypto::ssh::fmt::key(profile.id()));
println!(
"fingerprint: {}",
radicle::crypto::ssh::fmt::fingerprint(profile.id())
);
println!("home: {}", profile.home().path().display());
Ok(())
}

View File

@ -1,19 +0,0 @@
use radicle::{
storage::{WriteRepository, WriteStorage},
Profile,
};
fn main() -> anyhow::Result<()> {
let profile = Profile::load()?;
let (_, rid) = radicle::rad::cwd()?;
let repo = profile.storage.repository_mut(rid)?;
let id_oid = repo.set_identity_head()?;
let branch = repo.set_head()?;
println!("ok: identity: {id_oid}");
println!("ok: branch: {}", branch.new);
Ok(())
}