ywangd / stash

StaSh - Shell for Pythonista
MIT License
1.93k stars 227 forks source link

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

Open Tkizzy opened 8 years ago

Tkizzy commented 8 years ago

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.

ywangd commented 8 years ago

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

jsbain commented 8 years ago

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

Tkizzy commented 8 years ago

@jsbain you can clone a gist by doing git clone git@github.com: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 commented 8 years ago

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

Tkizzy commented 8 years ago

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

jsbain commented 8 years ago

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

Tkizzy commented 8 years ago

@jsbain: commenting out those lines worked.

Tkizzy commented 8 years ago

Should I close this issue?