magithub
magithub copied to clipboard
Support URL aliases from .gitconfig
My ~/.gitconfig is as follows:
[user]
name = Tony Olagbaiye
email = [email protected]
[push]
default = simple
[credential]
helper = cache
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
[url "[email protected]:"]
insteadOf = "heroku:"
[github]
user = bqv
This means I can clone and push to repositories with remote urls that look like gh:vermiculus/magithub.
It would be great if magithub could detect these and treat them as github repositories instead of me having to manually change all my remotes.
Is there a way to ask git to resolve a URL with these rules?
Looks like this can be done with git ls-remote --get-url
git remote seems more appropriate here, git ls-remote is about getting up-to-date data from the remote in most case. --get-url is one of the other cases.
Would this make sense as a patch to magit?
A patch to do what exactly?
Maybe if there's a function that gets a URL from a remote (on mobile right now or maybe of have a code reference). If that's so, then it may be made to handle this.
Sorry I can't provide more details right now :-(