upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/cli.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-20 21:54:00 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-20 21:54:00 +0000
commit8f1a1743bd4e85e922ec0cc1f050911a28af4cf0 (patch)
tree2d9eb4954395b62c66d1cc937c6e78a060129f3f /src/bin/ngit/cli.rs
parent67f09343c15e6a0e3622811d3eb5e513a8205eda (diff)
add `ngit repo` subcommand group
- `ngit repo` (no subcommand): show repository info including maintainer tree, per-maintainer infrastructure attribution, and a note explaining the union-vs-personal field model and recursive maintainer sets - `ngit repo init`: alias for `ngit init` - `ngit repo edit`: same as init but signals intent to update an existing repository announcement - `ngit repo accept`: scoped command for co-maintainers to publish their announcement; errors with clear messages for all other states (trusted maintainer, already accepted, not invited, no repo found)
Diffstat (limited to 'src/bin/ngit/cli.rs')
-rw-r--r--src/bin/ngit/cli.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs
index 037d17f..fa5d906 100644
--- a/src/bin/ngit/cli.rs
+++ b/src/bin/ngit/cli.rs
@@ -106,6 +106,11 @@ pub enum Commands {
106 /// publish a repository to nostr; signal you are its maintainer accepting 106 /// publish a repository to nostr; signal you are its maintainer accepting
107 /// PRs and issues 107 /// PRs and issues
108 Init(sub_commands::init::SubCommandArgs), 108 Init(sub_commands::init::SubCommandArgs),
109 /// manage repository metadata and maintainership
110 #[command(
111 long_about = "manage repository metadata and maintainership\n\nrun without a subcommand to show repository info"
112 )]
113 Repo(RepoSubCommandArgs),
109 /// submit PR with advanced options 114 /// submit PR with advanced options
110 #[command( 115 #[command(
111 long_about = "submit PR with advanced options\n\nfor a simpler flow, push a branch with the `pr/` prefix using native git:\n git push -o 'title=My PR' -o 'description=details here' -u origin pr/my-branch" 116 long_about = "submit PR with advanced options\n\nfor a simpler flow, push a branch with the `pr/` prefix using native git:\n git push -o 'title=My PR' -o 'description=details here' -u origin pr/my-branch"
@@ -177,3 +182,27 @@ pub struct AccountSubCommandArgs {
177 #[command(subcommand)] 182 #[command(subcommand)]
178 pub account_command: AccountCommands, 183 pub account_command: AccountCommands,
179} 184}
185
186#[derive(clap::Parser)]
187pub struct RepoSubCommandArgs {
188 #[command(subcommand)]
189 pub repo_command: Option<RepoCommands>,
190}
191
192#[derive(Subcommand)]
193pub enum RepoCommands {
194 /// publish a repository to nostr (alias for `ngit init`)
195 Init(sub_commands::init::SubCommandArgs),
196 /// update repository metadata on nostr
197 #[command(
198 long_about = "update repository metadata on nostr\n\nlike `ngit init` but makes clear you are editing an existing repository"
199 )]
200 Edit(sub_commands::init::SubCommandArgs),
201 /// accept an invitation to co-maintain a repository
202 #[command(long_about = "accept an invitation to co-maintain a repository\n\n\
203 publishes your repository announcement to nostr, confirming your co-maintainership.\n\n\
204 This is required because your signed announcement is what ties your git state events\n\
205 to a specific repository coordinate chain, preventing scammers from attributing your\n\
206 commits to a fake repository. See `ngit repo info` for details on the maintainer model.")]
207 Accept(sub_commands::repo::accept::SubCommandArgs),
208}