absolute and relative paths with ssh

Zbynek Winkler zwin at users.sourceforge.net
Fri Sep 16 16:48:01 CDT 2005


Bryan O'Sullivan wrote:

>>I think that '/' as a separator between the host name and the directory 
>>is confusing unless the resulting path is absolute.
>>    
>>
>It may be confusing to you personally, but it's the standard syntax:
>
>http://tools.ietf.org/wg/secsh/draft-ietf-secsh-scp-sftp-ssh-uri/draft-ietf-secsh-scp-sftp-ssh-uri-03.txt
>  
>
Ok, I didn't know that. I based my expectations on scp 
http://en.wikipedia.org/wiki/Secure_copy where the syntax is different

> scp fileToCopy user at host:directory/file
> scp user at host:folder/fileToCopy file

It just feels more natural to have the path relative to the home 
directory not starting with '/'.

I tried to read http://www.ietf.org/rfc/rfc3986.txt but it is not that 
easy :(. However I didn't quite understand the section 3.3 Path that 
defines the part of the uri in question :(

Zbynek

PS. First I tought that the fact this uri works is a bug (according to 
the rfc).
    ssh://user@example.com/~/hg/
But (according to the RFC) the first '/' gets eaten as a separator which 
leaves "~/hg/" to be interpreted relative to the users home directory. 
If that equals to "$HOME/hg/", it expands to "/home/user/hg/" which hits 
the case to define an absolute path (and that is where the double '/' 
comes from). Hmm.

But still - am I the only one who thinks that it is "strange" when
    ssh://user@example.com/~/hg/
means the same thing as
    ssh://user@example.com/hg/
???
IMHO it goes against the convention for http where
    http://user@example.com/~/hg/
is really something different from
    http://user@example.com/hg/

Shouldn't we respect that?

-- 
http://zw.matfyz.cz/     http://robotika.cz/
Faculty of Mathematics and Physics, Charles University, Prague, Czech Republic



More information about the Mercurial mailing list