From 37244449d6d0d58bb639f181bd15092de1acaaee Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 5 Mar 2026 14:19:49 +0000 Subject: feat(cover-note): add kind-1624 cover notes for PRs, patches, and issues Implements experimental kind-1624 cover note events: - KIND_COVER_NOTE constant and process_cover_note() in git_events.rs; replaceable semantics (latest created_at, hex-id tiebreak), author or maintainer only - kind-1624 events fetched alongside labels in the fetch pipeline; cover_notes count added to FetchReport display - ngit pr/issue view: cover note displayed in place of description with a clear 'Cover Note:' header; maintainer-authored notes identify the author; original description shown only with --comments; cover_note object included in --json output - ngit pr set-cover-note / ngit issue set-cover-note: publish a kind-1624 event; nostr: mentions in --body converted to q/p tags via tags_from_content (same rules as issue --body) - Fix pre-existing clippy::too_many_lines on repo/mod.rs show_info --- src/bin/ngit/sub_commands/repo/mod.rs | 71 ++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 30 deletions(-) (limited to 'src/bin/ngit/sub_commands/repo') diff --git a/src/bin/ngit/sub_commands/repo/mod.rs b/src/bin/ngit/sub_commands/repo/mod.rs index 63d96bd..766b025 100644 --- a/src/bin/ngit/sub_commands/repo/mod.rs +++ b/src/bin/ngit/sub_commands/repo/mod.rs @@ -74,6 +74,7 @@ struct RepoInfoJson { // `ngit repo` (no subcommand) — show repository info // --------------------------------------------------------------------------- +#[allow(clippy::too_many_lines)] async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { let git_repo = Repo::discover().context("failed to find a git repository")?; let git_repo_path = git_repo.get_path()?; @@ -98,20 +99,23 @@ async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { let Some(repo_coordinate) = repo_coordinate else { if json { - println!("{}", serde_json::to_string_pretty(&RepoInfoJson { - is_nostr_repo: false, - name: None, - identifier: None, - description: None, - nostr_url: None, - coordinate: None, - web: None, - maintainers: None, - grasp_servers: None, - git_servers: None, - relays: None, - hashtags: None, - })?); + println!( + "{}", + serde_json::to_string_pretty(&RepoInfoJson { + is_nostr_repo: false, + name: None, + identifier: None, + description: None, + nostr_url: None, + coordinate: None, + web: None, + maintainers: None, + grasp_servers: None, + git_servers: None, + relays: None, + hashtags: None, + })? + ); } else { println!("subcommands: init, edit, accept (run `ngit repo --help` for details)"); println!(); @@ -140,20 +144,23 @@ async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { .ok() .and_then(|r| r.url().map(std::string::ToString::to_string)) .filter(|u| u.starts_with("nostr://")); - println!("{}", serde_json::to_string_pretty(&RepoInfoJson { - is_nostr_repo: true, - name: None, - identifier: Some(repo_coordinate.identifier.clone()), - description: None, - nostr_url, - coordinate: repo_coordinate.to_bech32().ok(), - web: None, - maintainers: None, - grasp_servers: None, - git_servers: None, - relays: None, - hashtags: None, - })?); + println!( + "{}", + serde_json::to_string_pretty(&RepoInfoJson { + is_nostr_repo: true, + name: None, + identifier: Some(repo_coordinate.identifier.clone()), + description: None, + nostr_url, + coordinate: repo_coordinate.to_bech32().ok(), + web: None, + maintainers: None, + grasp_servers: None, + git_servers: None, + relays: None, + hashtags: None, + })? + ); } else { println!("subcommands: init, edit, accept (run `ngit repo --help` for details)"); println!(); @@ -162,8 +169,12 @@ async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { repo_coordinate.identifier ); println!(); - println!("if you created this repository, run `ngit repo init` to publish an announcement"); - println!("if you are a co-maintainer, run `ngit repo accept` to publish your announcement"); + println!( + "if you created this repository, run `ngit repo init` to publish an announcement" + ); + println!( + "if you are a co-maintainer, run `ngit repo accept` to publish your announcement" + ); } return Ok(()); }; -- cgit v1.2.3