darcs

Issue 2673 clone: inconsistencies in destination dir (put vs. get)

Title clone: inconsistencies in destination dir (put vs. get)
Priority Status unknown
Milestone Resolved in
Superseder Nosy List gpiero
Assigned To
Topics

Created on 2021-01-23.08:54:34 by gpiero, last changed 2021-01-24.11:17:22 by bf.

Messages
msg22624 (view) Author: gpiero Date: 2021-01-23.08:54:30
$ darcs --version 
2.16.3 (+ 180 patches)

$ darcs ini R
Finished initializing repository.
$ darcs clone R local-local
Copying patches, to get lazy repository hit ctrl-C...
Finished cloning.
$ darcs clone localhost.:$(pwd)/R remote-local
Copying patches, to get lazy repository hit ctrl-C...
Finished cloning.
$ ls -1d */_darcs
R/_darcs
local-local/_darcs
remote-local/_darcs

So far, so good...

$ darcs clone R localhost.:$(pwd)/local-remote
Creating local clone...
Transferring clone using scp...
Cloning and transferring successful.
$ darcs clone localhost.:$(pwd)/R localhost.:$(pwd)/remote-remote
Creating local clone...
Transferring clone using scp...
Cloning and transferring successful.
$ ls -1d */*/_darcs
local-remote/R/_darcs
remote-remote/R/_darcs

When creating the repo on a remote host, darcs appends the basename of 
the repodir to the provided path. This does not happen if the 
destination dir is on the local host. Different combinations of trailing 
slashes do not change the results.
msg22625 (view) Author: bf Date: 2021-01-23.18:21:07
Sorry, dumb question first:

> $ darcs clone localhost.:$(pwd)/R remote-local

What does the single "."after the "localhost" mean?
msg22626 (view) Author: gpiero Date: 2021-01-23.21:24:14
* [Sat, Jan 23, 2021 at 06:21:10PM +0000] Ben Franksen:
>> $ darcs clone localhost.:$(pwd)/R remote-local
>
>What does the single "."after the "localhost" mean?

 From a DNS resolver's point of view it denotes the root domain, so the 
resolver knows it is a fully qualified domain name (e.g.: the real fqdn 
for 'www.darcs.net' is 'www.darcs.net.', the trailing dot is just 
usually omitted and silently granted for).
 From SSH's point of view, as I use a few Canonical* options in my 
configuration, in conjunction with CanonicalizeMaxDots=0 it means: do 
not canonicalize the provided hostname.
So you can just consider 'localhost.' equivalent to 'localhost' for the 
general case.
msg22628 (view) Author: bf Date: 2021-01-24.10:52:55
>  From a DNS resolver's point of view it denotes the root domain, so the 
> resolver knows it is a fully qualified domain name

Thanks, I didn't know that.

> So you can just consider 'localhost.' equivalent to 'localhost' for the 
> general case.

Okay, got it.
msg22630 (view) Author: bf Date: 2021-01-24.11:17:19
I think I have caused this misbehavior when I tried to make clone-to-
ssh ("put") work with DARCS_SCP=rsync. rsync is often quite a lot 
faster than scp but has slightly different semantics when recursively 
copying directories. The relevant code is in 
src/Darcs/UI/Commands/Clone.hs lines 210-214.
History
Date User Action Args
2021-01-23 08:54:34gpierocreate
2021-01-23 18:21:10bfsetmessages: + msg22625
2021-01-23 21:24:18gpierosetmessages: + msg22626
2021-01-24 10:52:58bfsetmessages: + msg22628
2021-01-24 11:17:22bfsetmessages: + msg22630