From 492cc67887855cecb3fb501c4b61af50bf645b73 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 1 Dec 2023 00:00:00 +0000 Subject: feat(helper) add capabilities cmd as specified in https://git-scm.com/docs/gitremote-helpers --- nostr_git_remote_helper/src/main.rs | 8 ++++++++ nostr_git_remote_helper/src/sub_commands/capabilities.rs | 8 ++++++++ nostr_git_remote_helper/src/sub_commands/mod.rs | 1 + 3 files changed, 17 insertions(+) create mode 100644 nostr_git_remote_helper/src/sub_commands/capabilities.rs (limited to 'nostr_git_remote_helper/src') diff --git a/nostr_git_remote_helper/src/main.rs b/nostr_git_remote_helper/src/main.rs index 05e3fab..898f069 100644 --- a/nostr_git_remote_helper/src/main.rs +++ b/nostr_git_remote_helper/src/main.rs @@ -18,12 +18,20 @@ pub struct Cli { enum Commands { /// replace with an actual subcommand Placeholder(sub_commands::placeholder::SubCommandArgs), + Capabilities(), + // list + // - get git list from remote git server + // - suppliment list with open prs and send back + // - get prs + // - get commits against pr + // - find most recent commit against pr } #[tokio::main] async fn main() -> Result<()> { let cli = Cli::parse(); match &cli.command { + Commands::Capabilities() => sub_commands::capabilities::launch(), Commands::Placeholder(args) => { futures::executor::block_on(sub_commands::placeholder::launch(&cli, args)) } diff --git a/nostr_git_remote_helper/src/sub_commands/capabilities.rs b/nostr_git_remote_helper/src/sub_commands/capabilities.rs new file mode 100644 index 0000000..325cb3b --- /dev/null +++ b/nostr_git_remote_helper/src/sub_commands/capabilities.rs @@ -0,0 +1,8 @@ +use anyhow::Result; + +// https://git-scm.com/docs/gitremote-helpers#_capabilities +pub async fn launch() -> Result<()> { + // blank line indicates end of capabilities + println(""); + Ok(()) +} diff --git a/nostr_git_remote_helper/src/sub_commands/mod.rs b/nostr_git_remote_helper/src/sub_commands/mod.rs index b12a94a..c60ab7a 100644 --- a/nostr_git_remote_helper/src/sub_commands/mod.rs +++ b/nostr_git_remote_helper/src/sub_commands/mod.rs @@ -1 +1,2 @@ +pub mod capabilities; pub mod placeholder; -- cgit v1.2.3