Skip to content

Use raw remote URL to parse GitHub repo info#224

Open
matias-christensen-skydio wants to merge 1 commit intomainfrom
fix-remote-url-parsing
Open

Use raw remote URL to parse GitHub repo info#224
matias-christensen-skydio wants to merge 1 commit intomainfrom
fix-remote-url-parsing

Conversation

@matias-christensen-skydio
Copy link
Contributor

Summary

git remote get-url applies url.*.insteadOf rewriting before returning the URL. If a user has configured insteadOf rules that rewrite the hostname (e.g. to route through a custom SSH host alias), the returned URL no longer contains "github.com" and revup fails to extract the repo owner and name.

This changes get_github_repo_info to use git config --get remote.<name>.url instead, which reads the URL exactly as stored in the repo config before any rewriting is applied. The stored URL is what the user originally configured to point at GitHub, so it will always be parseable. The insteadOf rewriting still takes effect for all actual git operations (fetch, push, etc.) since those go through the normal git remote machinery.

git remote get-url applies url.*.insteadOf rewriting before returning
the URL. If a user has configured insteadOf rules that rewrite the
hostname (e.g. to route through a custom SSH host alias), the returned
URL no longer contains "github.com" and revup fails to extract the
repo owner and name.

Using git config --get reads the URL exactly as stored in the repo
config, before any rewriting is applied. The stored URL is what the
user originally configured to point at GitHub, so it will always be
parseable. The insteadOf rewriting still takes effect for all actual
git operations (fetch, push, etc.) since those go through the normal
git remote machinery.
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

Successfully merging this pull request may close these issues.

1 participant