Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get remote url with git remote get-url #135

Open
sarmong opened this issue Jun 11, 2024 · 2 comments
Open

Get remote url with git remote get-url #135

sarmong opened this issue Jun 11, 2024 · 2 comments

Comments

@sarmong
Copy link

sarmong commented Jun 11, 2024

Current implementation uses git config --get remote.origin.url which is problematic when there is an insteadOf in git config.

E.g. I have this:

[url "[email protected]:"]
  insteadOf = "gh:"

So, git config --get remote.origin.url returns gh:user/repo and thus fails to open in a URL. Whereas git remote get-url origin will return HTTP or SSH url, that can be then used.

@f-person
Copy link
Owner

Hi, yeah this makes sense. Maybe we could convert such behaviors into configurable ones via some strategy enums?
I think there was a similar case a while ago that would benefit from this approach

@sarmong
Copy link
Author

sarmong commented Jun 12, 2024

I am not sure what would be the usecase of using url from config instead of remote get-url.
For example gitlinker.nvim does it this way and I haven't seen any issues raised there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants