MacOS zsh cannot clone repository

ngit Version 1.4.4

MacOS version: 14.1.2

I cannot clone a repository using zsh in MacOS, which is the default shell for this OS.

output: ```zsh

zsh: no matches found: nostr://npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit?relayhint=relay.damus.io

```

It works under bash.

Reply to this note

Please Login to reply.

Discussion

It doesn't work for me under bash. I get

```console

$ git clone nostr://npub1m4ny6hjqzepn4rxknuq94c2gpqzr29ufkkw7ttcxyak7v43n6vvsajc2jl/Alexandria?relayhint=nostr.thesamecat.io

Cloning into 'Alexandria?relayhint=nostr.thesamecat.io'...

nostr: no updates

Error: no repo events at specified coordinates

```

```console

$ git-remote-nostr --help

Error: git should set GIT_DIR when remote helper is called

Caused by: environment variable not found

```

v1.4.5 should fix this under bash

Have v1.4.5 now, but it stayed the same.

Your still getting the 'no repo event at specified coordinates' error?

And you definitely installed to upgraded remote helper too?

$ git clone nostr://npub1m4ny6hjqzepn4rxknuq94c2gpqzr29ufkkw7ttcxyak7v43n6vvsajc2jl/Alexandria?relayhint=nostr.thesamecat.io

Cloning into 'Alexandria?relayhint=nostr.thesamecat.io'...

nostr: no updates

Error: no repo events at specified coordinates

$ git-remote-nostr --help

Error: git should set GIT_DIR when remote helper is called

Caused by:

environment variable not found

$ git-remote-nostr --version

v1.4.5

$ ngit --version

ngit 1.4.5

this is failing because the nostr url points to nostr:npub1m4ny6hjqzepn4rxknuq94c2gpqzr29ufkkw7ttcxyak7v43n6vvsajc2jl who doesn't have a git repository with the identifier Alexandria. try nostr:npub1l5sga6xg72phsz5422ykujprejwud075ggrr3z2hwyrfgr7eylqstegx9z

a good way of finding the right nostr url to use is to view https://gitworkshop.dev/repos as you can select a repo and copy the clone url via the green 'clone' button

OMG Duh

Okay, it worked!

But I now have a folder called 'Alexandria?relayhint=nostr.thesamecat.io' even inluding the apostrophes. Can it just be called Alexandria or do I have to rename it?

you can rename it or name it as part of the clone command `git clone nostr://npub123/my-repo my-repo-directory

if you think it should default to the identifier please comment here:

nostr:nevent1qvzqqqqqqypzpgqgmmc409hm4xsdd74sf68a2uyf9pwel4g9mfdg8l5244t6x4jdqy88wumn8ghj7mn0wvhxcmmv9uq3wamnwvaz7tmjv4kxz7fwdehhxarj9e3xzmny9uqzprw74s2x43t6ghuscx9cve57qm9l2elwlx5ln9h2ktp69hxm74fmqtwjna

Do you think its worth changing? I think its only ngit that currently uses it so no other client will need to change.

Oh, I didn't even see that bright green button. Sort of hard to miss.

advertising has trained us to ignore bright shiny things on websites.

I'm open to suggestion on how to make it clearer. the 'new issue' and clone buttons are perhaps too similar.

Yeah, they all look the same. Maybe something more subtle, next to the name?

I could use one of the other coloured buttons. If I remember correctly its the most prominent thing on the github repo page. A big green button called 'Code'.

It is. Maybe it's just too far off, to the right. Out of the field I was looking at. Legit didn't even notice it was there.

I moved it and tried a few other things but not 100% happy. Maybe I should pull the instructions out of the down to makenitnmore prominent?

I think it looks pretty good, actually. 🤔

Thanks. We will stick with that for now then.

Do I have to manually set GIT_DIR?

Git calls the remote helper with that environment variable set along with a few others.

So, no?

correct

Same here just as Laeserin mentioned.

ngit 1.4.5

❯ git remote add ngit nostr://npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe/nuxstr?relayhint=wss%3A%2F%2Fnostr.sebastix.dev%2F

zsh: no matches found: nostr://npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe/nuxstr?relayhint=wss%3A%2F%2Fnostr.sebastix.dev%2F

❯ bash

The default interactive shell is now zsh.

To update your account to use zsh, please run `chsh -s /bin/zsh`.

For more details, please visit https://support.apple.com/kb/HT208050.

bash-3.2$ git remote add ngit nostr://npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe/nuxstr?relayhint=wss%3A%2F%2Fnostr.sebastix.dev%2F

bash-3.2$ git remote -v

gitlab git@gitlab.com:sebastix-group/nostr/nuxstr.git (fetch)

gitlab git@gitlab.com:sebastix-group/nostr/nuxstr.git (push)

ngit nostr://npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe/nuxstr?relayhint=wss%3A%2F%2Fnostr.sebastix.dev%2F (fetch)

ngit nostr://npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe/nuxstr?relayhint=wss%3A%2F%2Fnostr.sebastix.dev%2F (push)

origin git@github.com:Sebastix/vue-nuxt-nostr-ndk.git (fetch)

origin git@github.com:Sebastix/vue-nuxt-nostr-ndk.git (push)

As of ngit 1.4.5, with zsh the git clone command trips over `?relayhint=nostr.sprovoost.nl`

It does work with bash.

Unless the url is passed in quotes, zsh (terminal emulator on macos) interprets the `?` as a pattern matching and produces the `zsh: no matches found` error.

In the next ngit release a different format for the nostr url will be supported that doesn't include this gotcha for macos users. When that's out also I'll update gitworkshop.dev to produce this format.

cc: nostr:npub1m4ny6hjqzepn4rxknuq94c2gpqzr29ufkkw7ttcxyak7v43n6vvsajc2jl nostr:npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe