stash icon indicating copy to clipboard operation
stash copied to clipboard

`git fetch` fails for gists (even while `git pull` works)

Open Tkizzy opened this issue 8 years ago • 8 comments


git fetch

stash: <type 'exceptions.Exception'>: url must match a remote name, or must start with http:// or https:// 

Git pull works. If this is expected behavior for gists, my apologies.

Tkizzy avatar Jul 18 '16 03:07 Tkizzy

Hmm I am not quite sure. @jsbain Could you please enlighten us?

ywangd avatar Jul 18 '16 04:07 ywangd

How did you set up the repo? git clone, or something else? I am not able to clone a gist at all.

jsbain avatar Jul 18 '16 06:07 jsbain

@jsbain you can clone a gist by doing git clone [email protected]:0d5a709bbb4186d1f45f2af14c65b110.git to access @omz's https://gist.github.com/omz/0d5a709bbb4186d1f45f2af14c65b110. I only figured out how to do that thanks to stack overflow.

Only tangentially related to this, I want to try to make a share sheet action that will create a directory in a pre-specified place, and clone a gist/repo by launching stash and passing arguments to do that - only I have no idea what the methodology is for passing arguments to the launch_stash.py script, so you can be on a gist/repo in safari, launch the share sheet/Pythonista and select the script and have it launch Pythonista, launch stash, and enter the appropriate commands into stash.

Tkizzy avatar Jul 18 '16 06:07 Tkizzy

Oh I wonder if it's because I didn't use http:// or https:// ....

Tkizzy avatar Jul 18 '16 06:07 Tkizzy

And I don't know how it would use those with this format...

Tkizzy avatar Jul 18 '16 06:07 Tkizzy

ahh, i think this might be using ssh. i have some checks that there is a valid scheme, which was from before ssh was supported (basically, to stop confusing problems when dulwich fried to default to a File based repository). If you comment out line 481/482 in git.py

    if not urlparse.urlparse(result.url).scheme:
        raise Exception('url must match a remote name, or must start with http:// or https://')

let me know if that works.p, and we can think of a more robust solution

jsbain avatar Jul 18 '16 07:07 jsbain

@jsbain: commenting out those lines worked.

Tkizzy avatar Jul 18 '16 07:07 Tkizzy

Should I close this issue?

Tkizzy avatar Jul 18 '16 11:07 Tkizzy