x-motemen/ghq

Repository URL get-urlmatch filter for SSH connections?

Opened this issue · 0 comments

Considering a configuration that looks like

$ ll ~/src ~/ssc                        
lrwxrwxrwx 1 yala yala 14 Okt  5 16:51 /home/yala/src -> /srv/idata/src/
lrwxrwxrwx 1 yala yala 39 Dez  7 18:43 /home/yala/ssc -> /srv/idata/Hosts/ganglion/home/yala/ssc/

and

[ghq]
vcs = git
root = ~/src

[ghq "git@github.com"]
vcs = git
root = ~/ssc

it is not possible to use ghq to clone repositories via SSH into ~/ssc (secure source code) for separation of protocol concerns.

$ ghq get git@github.com:almereyda/awesome-starred.git
     clone ssh://git@github.com/almereyda/awesome-starred.git -> /home/yala/src/github.com/almereyda/awesome-starred
       git clone --recursive ssh://git@github.com/almereyda/awesome-starred.git /home/yala/src/github.com/almereyda/awesome-starred
Klone nach '/home/yala/src/github.com/almereyda/awesome-starred' ...
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 87 (delta 6), reused 0 (delta 0), pack-reused 66
Empfange Objekte: 100% (87/87), 785.79 KiB | 358.00 KiB/s, Fertig.
Löse Unterschiede auf: 100% (27/27), Fertig.

$ ghq get git@github.com:almereyda/awesome-starred.git
    exists /srv/idata/src/github.com/almereyda/awesome-starred
$ ghq get -p git@github.com:almereyda/awesome-starred.git
    exists /srv/idata/src/github.com/almereyda/awesome-starred

Also adding the scheme with ssh://git@github.com or even git+ssh://git@github.com each with and without the colon : didn't yield sufficient results.

How can I tell ghq to clone repositories via SSH into a different root directory?