From 902c1ae57481312cacc421f73c6094760f2e9f8a Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 9 Oct 2026 11:41:50 +0200 Subject: [PATCH] hive-forge: subscription --ignore refuses instead of silently watching (#5052) --- hive-forge/src/verbs/subscription.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/hive-forge/src/verbs/subscription.rs b/hive-forge/src/verbs/subscription.rs index 621a4c48..5dabb859 100644 --- a/hive-forge/src/verbs/subscription.rs +++ b/hive-forge/src/verbs/subscription.rs @@ -21,7 +21,8 @@ pub struct Args { /// Subscribe (watch the repo). #[arg(long, group = "action")] watch: bool, - /// Mute (mark ignored). + /// Unsupported: Forgejo's subscription endpoint can't mark a repo + /// ignored without also watching it. Always refuses with an error. #[arg(long, group = "action")] ignore: bool, /// Unsubscribe (clear watch + ignore). @@ -72,12 +73,22 @@ pub fn run(client: &Client, args: Args) -> Result<()> { println!("unsubscribed"); return Ok(()); } - if args.watch || args.ignore { + if args.ignore { // Forgejo's PUT subscription endpoint takes no body — it always - // subscribes (watch). The old raw client sent a + // subscribes (watch), it has no way to mark a repo ignored + // without also watching it. The old raw client sent a // `{subscribed, ignored}` body which the server ignored, so - // `--ignore` has always behaved like `--watch` server-side; the - // typed call just makes that explicit. + // `--ignore` silently behaved like `--watch` (the opposite of + // what it promises) instead of failing. Refuse instead of lying + // about what happened. + anyhow::bail!( + "subscription --ignore is not supported: Forgejo's subscription \ + endpoint has no way to mark a repo ignored without also \ + watching it. Use --unwatch to stop watching, or --watch if \ + muted-but-watched is what you actually want." + ); + } + if args.watch { let resp = client .api() .user_current_put_subscription(owner, name)