From 7f7827e445029799400aacf69838e26299b6dc10 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 4 Mar 2026 15:09:54 +0000 Subject: fix NIP-22 compliance and add --reply-to flag for issue/PR comments - Add missing P and p tags (root and parent author pubkeys) - Fix E tag 4th element to be root pubkey (was empty string) - Fix e tag 4th element to be parent pubkey (was "reply", a NIP-10 convention) - Add --reply-to flag to both issue and PR comment commands - When --reply-to is set, look up the parent comment from cache and use it as the parent scope (e/k/p); root scope (E/K/P) always stays the issue/PR - When --reply-to is omitted, parent == root (existing top-level behaviour) --- src/bin/ngit/main.rs | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'src/bin/ngit/main.rs') diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs index 2982b61..03a5ce9 100644 --- a/src/bin/ngit/main.rs +++ b/src/bin/ngit/main.rs @@ -90,8 +90,19 @@ async fn main() { PrCommands::Ready { id, offline } => { sub_commands::pr_status::launch_ready(id, *offline).await } - PrCommands::Comment { id, body, offline } => { - sub_commands::comment::launch_pr_comment(id, body, *offline).await + PrCommands::Comment { + id, + body, + reply_to, + offline, + } => { + sub_commands::comment::launch_pr_comment( + id, + body, + reply_to.as_deref(), + *offline, + ) + .await } PrCommands::Merge { id, @@ -140,8 +151,19 @@ async fn main() { IssueCommands::Reopen { id, offline } => { sub_commands::issue_status::launch_reopen(id, *offline).await } - IssueCommands::Comment { id, body, offline } => { - sub_commands::comment::launch_issue_comment(id, body, *offline).await + IssueCommands::Comment { + id, + body, + reply_to, + offline, + } => { + sub_commands::comment::launch_issue_comment( + id, + body, + reply_to.as_deref(), + *offline, + ) + .await } }, Commands::Sync(args) => sub_commands::sync::launch(args).await, -- cgit v1.2.3