Here is a suggestion for updating the nostr:// git standard based on needs emerging from usage: nostr://ssh/npub123/relay.damus.io/my-repo nostr://npub123/my-repo?relayhint=relay.damus.io&server-protocol=ssh nostr://naddr123* *no support for specifying server protocol note that `git clone nostr://...` will name the directory with anything after the final `/` unless a directory name is specified. I personally think the first format has the best balance of conciseness and readability. To articulate it more precisely, rather than by example, it is: `nostr://<optional-protocol/<required-npub>/<optional-relay>/<optional-relay-2..n>/<required-identifier>` I'd love some feedback before implementing. @fiatjaf @sommerfeld @sommerfeld @npub1uplx...sfek @GitCitadel

Replies (5)

Having a means of specifying the git connection protocol looks good to me. Two things: 1. I personally prefer using a query string for relay hints and server protocol. It keeps the repo address itself concise and a little more human-friendly, while extra detail can be added as needed in the query. 2. In addition to npubs, will we be able to use NIP-05 addresses? Npubs are rather cumbersome. Ideally, I'd want to be able to type out a repo address into my command line, rather than always having to copy-paste it.
I've implemented this with `?protocol=<ssh|https|http|ftp|git>&user=<string>` or `nostr://fred@ssh/npub...` to enable overrides for push. I've also updated `ngit init` to default to using https clone urls, as this is the most sensible for fetch. Given that most repo events include ssh clone urls, I'm tempted to just always use https for fetch and ssh for push (with a https fallback) unless the `protocol` override is used. push failures of ssh are instant whereas over https sometimes needs to be prompted for credentials. Next up I need to actually implement the override.