tsoding/snitch

Snitch doesn't support repositories cloned over SSH with alias

mateossh opened this issue · 10 comments

Screenshot for better understanding

2019-08-19-092046_526x89_scrot

gh:.... is SSH alias in git config

  1. adding alias key to .ini files
  2. get URL the same way we get list of files to be checked? (strip the user part or just add it to regex)
rexim commented

@mfocko It would be cool if it just worked without any additional configuration. Maybe we can look at the git config for aliases?

As far as I remember Git config is also ini file. I will try to solve this issue when I find some free time.

@rexim maybe the second option then... we just run the first command from screenshot,,, it drops the need to look for .git in program and also processing the config as ini file
@mateossh it keeps alias in git config, that's why you got github.com with get-url and snitch failed (it parses .git/config)

EDIT:
@mateossh the git command probably resolves the alias before printing out the url

Checked it on archLinux install... It doesn't resolve aliases for me, so I'm bit confused about it

@rexim So maybe going with parsing the ssh config?

rexim commented

@mfocko but the description says it's in the git config

gh:.... is SSH alias in git config

I'm confused. Where is the alias? In ssh config or git config? :)

@rexim You configure "hosts" in ssh config, assign hostname, auth, etc. And git just uses it :D so .git/config contains only alias and ssh/config both alias and real hostname

Edit:
However if we use git remote get-url origin, we don't need to locate .git and parse it, also it could probably help with #145?

rexim commented

All of that sounds over complicated. Let's solve this problem via #146

@rexim So you want to specify the host directly in .snitch.yaml if I understand correctly?
Also if you specify it in config file, you have no need to locate and parse .git/config, which seems nice, just need to check if there are credentials for the host.

@mfocko @rexim You can create alias in two ways:

  1. In git config -> ~/.gitconfig
  2. In ssh config -> ~/.ssh/config

I created PR, please take a look at #160