Skydio / revup

Effortlessly create and manage pull requests without changing branches. Powers a stacked diffs workflow with python and git "plumbing" commands.
https://github.com/Skydio/revup
MIT License
310 stars 61 forks source link

revup github ssh repo regex assumes username is `git` #72

Closed anguslees closed 1 year ago

anguslees commented 1 year ago
RuntimeError: Configured remote "origin" does not
point to the a github repository!
You can set it manually by running
git remote set-url origin git@github.com:{OWNER}/{PROJECT}
or change the configured remote in /Users/gus/.revupconfig
% git remote -v
origin  org-1234567@github.com:Company/repo.git (fetch)
origin  org-1234567@github.com:Company/repo.git (push)

I think this regex: https://github.com/Skydio/revup/blob/4b357f91e3982362266d77cec4051e1cebde32e4/revup/github_utils.py#L25

... should be rf"^[^@]+@{github_url}:([^/]+)/([^.]+)(?:\.git)?$".

When I hack that change locally, revup works for me.

jerry-skydio commented 1 year ago

Thanks, I think you're right. I'm a little confused because I don't see any reference in github's docs to any username other than git@github.com (such as https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection). Do you know why the username would be different? Is this an enterprise feature / are there docs for what the username can be?

anguslees commented 1 year ago

🤷 I should know more about our corporate github setup, but I don't. Afaik, I think it's regular github-cloud, but definitely a private org/repo. I can find out more if it's important.

(Loving revup btw)

jerry-skydio commented 1 year ago

it would satisfy my curiosity as we also use a private repo and i've never seen this format before, but it defintely doesn't block making this fix as I don't see any downside to your proposed solution.

btw feel free to make pull requests in the future so you get credit for your contribution!

jerry-skydio commented 1 year ago

https://github.com/Skydio/revup/pull/74