From e63c30976e69d68a9542d7b348ac15a688aa527f Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Fri, 23 Jan 2026 14:53:23 +0100 Subject: [PATCH] cli/fork: Deprecate This command is confusing in name and function. Rather than creating a hard fork of a repository, with a new identity, it pushes the default branch to the local user's namespace. Deprecate it and add some help text. --- CHANGELOG.md | 5 +++++ crates/radicle-cli/examples/rad-help.md | 1 - crates/radicle-cli/src/commands/fork.rs | 3 ++- crates/radicle-cli/src/commands/fork/args.rs | 12 +++++++++++- crates/radicle-cli/src/main.rs | 1 + 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f92d953..a125864d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Deprecations +- The `rad fork` command was confusing, and mislead users as to what its purpose + was. Many believed it to create a hard-fork of the repository. Instead, it + pushed the default branch to the local user's namespace. The command is now + deprecated, and the user should use `git push` instead. + ## 1.6.1 ## Fixed Bugs diff --git a/crates/radicle-cli/examples/rad-help.md b/crates/radicle-cli/examples/rad-help.md index a2589de2..b997c19f 100644 --- a/crates/radicle-cli/examples/rad-help.md +++ b/crates/radicle-cli/examples/rad-help.md @@ -20,7 +20,6 @@ Commands: config Manage your local Radicle configuration debug Write out information to help debug your Radicle node remotely follow Manage node follow policies - fork Create a fork of a repository id Manage repository identities inbox Manage your Radicle notifications init Initialize a Radicle repository diff --git a/crates/radicle-cli/src/commands/fork.rs b/crates/radicle-cli/src/commands/fork.rs index 2ca236f3..89692737 100644 --- a/crates/radicle-cli/src/commands/fork.rs +++ b/crates/radicle-cli/src/commands/fork.rs @@ -4,11 +4,12 @@ use anyhow::Context as _; use radicle::rad; -use crate::terminal as term; +use crate::{terminal as term, warning}; pub use args::Args; pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> { + warning::deprecated("rad fork", "git push"); let profile = ctx.profile()?; let signer = profile.signer()?; let storage = &profile.storage; diff --git a/crates/radicle-cli/src/commands/fork/args.rs b/crates/radicle-cli/src/commands/fork/args.rs index 9c195548..a2374b3d 100644 --- a/crates/radicle-cli/src/commands/fork/args.rs +++ b/crates/radicle-cli/src/commands/fork/args.rs @@ -1,6 +1,16 @@ use radicle::identity::RepoId; -const ABOUT: &str = "Create a fork of a repository"; +const ABOUT: &str = "Create a fork of a repository + +This command is deprecated and will be removed. + +Instead of using `rad fork`, use `git push` to push any references to +your own namespace of a Radicle repository. Usually + + git push rad main + +would suffice to push the default branch (here named 'main'). +"; #[derive(Debug, clap::Parser)] #[command(about = ABOUT, disable_version_flag = true)] diff --git a/crates/radicle-cli/src/main.rs b/crates/radicle-cli/src/main.rs index 3aa59e47..77a42ce8 100644 --- a/crates/radicle-cli/src/main.rs +++ b/crates/radicle-cli/src/main.rs @@ -68,6 +68,7 @@ enum Command { Config(config::Args), Debug(debug::Args), Follow(follow::Args), + #[command(hide = true)] // `rad fork` command is deprecated Fork(fork::Args), Id(id::Args), Inbox(inbox::Args),