diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 14:19:49 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 14:23:07 +0000 |
| commit | 37244449d6d0d58bb639f181bd15092de1acaaee (patch) | |
| tree | 7de03867a1a9578e32fdbdbb2be63e863cea57a4 /src/bin/ngit/sub_commands/repo/mod.rs | |
| parent | 609f3c3db02d437222e2c8e171189179d06c3e9c (diff) | |
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
Diffstat (limited to 'src/bin/ngit/sub_commands/repo/mod.rs')
| -rw-r--r-- | src/bin/ngit/sub_commands/repo/mod.rs | 71 |
1 files changed, 41 insertions, 30 deletions
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 { | |||
| 74 | // `ngit repo` (no subcommand) — show repository info | 74 | // `ngit repo` (no subcommand) — show repository info |
| 75 | // --------------------------------------------------------------------------- | 75 | // --------------------------------------------------------------------------- |
| 76 | 76 | ||
| 77 | #[allow(clippy::too_many_lines)] | ||
| 77 | async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { | 78 | async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { |
| 78 | let git_repo = Repo::discover().context("failed to find a git repository")?; | 79 | let git_repo = Repo::discover().context("failed to find a git repository")?; |
| 79 | let git_repo_path = git_repo.get_path()?; | 80 | let git_repo_path = git_repo.get_path()?; |
| @@ -98,20 +99,23 @@ async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { | |||
| 98 | 99 | ||
| 99 | let Some(repo_coordinate) = repo_coordinate else { | 100 | let Some(repo_coordinate) = repo_coordinate else { |
| 100 | if json { | 101 | if json { |
| 101 | println!("{}", serde_json::to_string_pretty(&RepoInfoJson { | 102 | println!( |
| 102 | is_nostr_repo: false, | 103 | "{}", |
| 103 | name: None, | 104 | serde_json::to_string_pretty(&RepoInfoJson { |
| 104 | identifier: None, | 105 | is_nostr_repo: false, |
| 105 | description: None, | 106 | name: None, |
| 106 | nostr_url: None, | 107 | identifier: None, |
| 107 | coordinate: None, | 108 | description: None, |
| 108 | web: None, | 109 | nostr_url: None, |
| 109 | maintainers: None, | 110 | coordinate: None, |
| 110 | grasp_servers: None, | 111 | web: None, |
| 111 | git_servers: None, | 112 | maintainers: None, |
| 112 | relays: None, | 113 | grasp_servers: None, |
| 113 | hashtags: None, | 114 | git_servers: None, |
| 114 | })?); | 115 | relays: None, |
| 116 | hashtags: None, | ||
| 117 | })? | ||
| 118 | ); | ||
| 115 | } else { | 119 | } else { |
| 116 | println!("subcommands: init, edit, accept (run `ngit repo --help` for details)"); | 120 | println!("subcommands: init, edit, accept (run `ngit repo --help` for details)"); |
| 117 | println!(); | 121 | println!(); |
| @@ -140,20 +144,23 @@ async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { | |||
| 140 | .ok() | 144 | .ok() |
| 141 | .and_then(|r| r.url().map(std::string::ToString::to_string)) | 145 | .and_then(|r| r.url().map(std::string::ToString::to_string)) |
| 142 | .filter(|u| u.starts_with("nostr://")); | 146 | .filter(|u| u.starts_with("nostr://")); |
| 143 | println!("{}", serde_json::to_string_pretty(&RepoInfoJson { | 147 | println!( |
| 144 | is_nostr_repo: true, | 148 | "{}", |
| 145 | name: None, | 149 | serde_json::to_string_pretty(&RepoInfoJson { |
| 146 | identifier: Some(repo_coordinate.identifier.clone()), | 150 | is_nostr_repo: true, |
| 147 | description: None, | 151 | name: None, |
| 148 | nostr_url, | 152 | identifier: Some(repo_coordinate.identifier.clone()), |
| 149 | coordinate: repo_coordinate.to_bech32().ok(), | 153 | description: None, |
| 150 | web: None, | 154 | nostr_url, |
| 151 | maintainers: None, | 155 | coordinate: repo_coordinate.to_bech32().ok(), |
| 152 | grasp_servers: None, | 156 | web: None, |
| 153 | git_servers: None, | 157 | maintainers: None, |
| 154 | relays: None, | 158 | grasp_servers: None, |
| 155 | hashtags: None, | 159 | git_servers: None, |
| 156 | })?); | 160 | relays: None, |
| 161 | hashtags: None, | ||
| 162 | })? | ||
| 163 | ); | ||
| 157 | } else { | 164 | } else { |
| 158 | println!("subcommands: init, edit, accept (run `ngit repo --help` for details)"); | 165 | println!("subcommands: init, edit, accept (run `ngit repo --help` for details)"); |
| 159 | println!(); | 166 | println!(); |
| @@ -162,8 +169,12 @@ async fn show_info(cli_args: &Cli, offline: bool, json: bool) -> Result<()> { | |||
| 162 | repo_coordinate.identifier | 169 | repo_coordinate.identifier |
| 163 | ); | 170 | ); |
| 164 | println!(); | 171 | println!(); |
| 165 | println!("if you created this repository, run `ngit repo init` to publish an announcement"); | 172 | println!( |
| 166 | println!("if you are a co-maintainer, run `ngit repo accept` to publish your announcement"); | 173 | "if you created this repository, run `ngit repo init` to publish an announcement" |
| 174 | ); | ||
| 175 | println!( | ||
| 176 | "if you are a co-maintainer, run `ngit repo accept` to publish your announcement" | ||
| 177 | ); | ||
| 167 | } | 178 | } |
| 168 | return Ok(()); | 179 | return Ok(()); |
| 169 | }; | 180 | }; |