From f3fcf863aae000964753f574b00e9fb9f5fcd452 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 5 Mar 2026 13:03:50 +0000 Subject: feat(subject): add pr/issue set-subject via NIP-32 kind-1985 labels Adds the ability to update the displayed title of a PR or issue after creation using a kind-1985 label event with the #subject namespace. Only the author or a repository maintainer may set the subject. The latest authorised event wins with tiebreak by lexicographically larger event ID (NIP-1 replaceable event semantics). Branch names and commit messages are never affected. - Split get_labels() into process_labels() (additive #t) and process_subject() (replaceable-style #subject), with a shared get_labels_and_subject() entry point that processes both from a single pre-fetched slice of kind-1985 events - All list/view/JSON display paths apply the subject override silently - New ngit pr set-subject --subject command - New ngit issue set-subject --subject command --- src/bin/ngit/main.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/bin/ngit/main.rs') diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs index 3686011..1dbf020 100644 --- a/src/bin/ngit/main.rs +++ b/src/bin/ngit/main.rs @@ -3,7 +3,7 @@ #![cfg_attr(not(test), warn(clippy::expect_used))] use clap::Parser; -use cli::{AccountCommands, CUSTOMISE_TEMPLATE, Cli, Commands, IssueCommands, PrCommands}; +use cli::{AccountCommands, Cli, Commands, IssueCommands, PrCommands, CUSTOMISE_TEMPLATE}; mod cli; use ngit::{ @@ -138,6 +138,11 @@ async fn main() { labels, offline, } => sub_commands::label::launch_pr_label(id, labels, *offline).await, + PrCommands::SetSubject { + id, + subject, + offline, + } => sub_commands::set_subject::launch_pr_set_subject(id, subject, *offline).await, }, Commands::Issue(args) => match &args.issue_command { IssueCommands::List { @@ -210,6 +215,13 @@ async fn main() { labels, offline, } => sub_commands::label::launch_issue_label(id, labels, *offline).await, + IssueCommands::SetSubject { + id, + subject, + offline, + } => { + sub_commands::set_subject::launch_issue_set_subject(id, subject, *offline).await + } }, Commands::Sync(args) => sub_commands::sync::launch(args).await, } -- cgit v1.2.3