ghq icon indicating copy to clipboard operation
ghq copied to clipboard

Repository URL get-urlmatch filter for SSH connections?

Open almereyda opened this issue 4 years ago • 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 "[email protected]"]
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 [email protected]:almereyda/awesome-starred.git
     clone ssh://[email protected]/almereyda/awesome-starred.git -> /home/yala/src/github.com/almereyda/awesome-starred
       git clone --recursive ssh://[email protected]/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 [email protected]:almereyda/awesome-starred.git
    exists /srv/idata/src/github.com/almereyda/awesome-starred
$ ghq get -p [email protected]:almereyda/awesome-starred.git
    exists /srv/idata/src/github.com/almereyda/awesome-starred

Also adding the scheme with ssh://[email protected] or even git+ssh://[email protected] 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?

almereyda avatar Dec 07 '20 17:12 almereyda