sshaw / git-link

Emacs package to get the GitHub/Bitbucket/GitLab/... URL for a buffer location
399 stars 74 forks source link

[request] resolve ~/.ssh/config hosts #50

Closed emanresusername closed 6 years ago

emanresusername commented 6 years ago

what i did

for reference

assuming i have the following in my ~/.ssh/config

Host git-1
    HostName github.com
    IdentityFile ~/.ssh/1/id_rsa
Host git-2
    HostName github.com
    IdentityFile ~/.ssh/2/id_rsa
Host git-3
    HostName github.com
    IdentityFile ~/.ssh/3/id_rsa
#... etc...

and a git repo with the following in its .git/config

[remote "origin"]
    url = ssh://git-1:org/repo.git

use git-link

what happened

no handler for git-1 :(

what i want

link to github.com/org/repo/path/to/whatever/is/appropriate

no idea what this would take, apologies in advance if it's one of these 😅 https://xkcd.com/1425/

sshaw commented 6 years ago

Hi, thanks for the comic. I will be using that at work tomorrow.

As for your problem, you can add git-1 etc... to git-link-remote-alist.

So in your case, something like this (not tested):

(add-to-list 'git-link-remote-alist '("^git-[0-9]+" git-link-github))

Let me know if that works.

emanresusername commented 6 years ago

probably would have 😅 as it turned out this was all i needed and i could drop the fancy host ~/.ssh/config stuff 👌