darcs

Patch 2232 Fix clone to remote location

Title Fix clone to remote location
Superseder Nosy List ki11men0w
Related Issues
Status accepted Assigned To
Milestone

Created on 2022-03-27.19:58:42 by ki11men0w, last changed 2022-04-13.21:22:18 by bfrk.

Files
File name Status Uploaded Type Edit Remove
clarify-the-tricky-parts-of-clone-to-ssh.dpatch bfrk, 2022-04-13.21:22:18 application/x-darcs-patch
fix_-cloning-to-an-external-repository-led-to-the-creation-of-an-extra-nested-directory.dpatch ki11men0w, 2022-03-27.19:58:41 application/octet-stream
fix_-cloning-to-an-external-repository-led-to-the-creation-of-an-extra-nested-directory.dpatch bfrk, 2022-04-11.07:35:32 application/x-darcs-patch
patch-preview.txt bfrk, 2022-04-11.07:35:32 text/x-darcs-patch
patch-preview.txt bfrk, 2022-04-13.21:22:18 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg22955 (view) Author: ki11men0w Date: 2022-03-27.19:58:41
fix: cloning to an external repository led to the creation of an extra nested directory
  
Before copying the data using the scp command, a remote directory corresponding
to the new repository is created beforehand to check whether the contents of
this directory will not be deleted if it already exists. But if you leave this
directory, the scp command will create another directory inside it. Therefore,
before executing scp, we will delete the created directory.
Attachments
msg22957 (view) Author: bfrk Date: 2022-04-10.11:16:31
Thanks for the patch.

I have only one issue, which is a common pitfall in darcs: you should 
normally import System.Posix.FilePath, not the "native" System.FilePath. 
The precise reasoning for this is complicated but you can trust me it's 
the right thing to do here.

You can send a rebased version of your patch (preferred) or a follow-up 
patch. If you send by email, please use '[patch2232]' as the subject so 
it will be added to the same entry in the tracker.

In case you rebase, you may want to fix the typo in the log message 
("aplly").

Your patch also lifts a limitation: when the parent directory of the 
specified (remote) target repo does not exist, it will now be created, 
whereas previously the command would fail. This is appreciated, but you 
should perhaps mention it in the log message to make it easier to 
understand what's going on. Ideally we would want to have this split 
into two separate patches, but I am not insisting on it because the 
change is overall small and simple.
msg22960 (view) Author: bfrk Date: 2022-04-11.07:26:30
Sorry, it seems I was severely confused!

You did record this as two patches, and there is no typo in the log 
message. Please ignore these remarks. I will send a follow-up patch 
to fix the System.FilePath vs. System.Posix.FilePath thing and an 
extension of the tests/network/ssh.sh test script to cover both 
changes.
msg22961 (view) Author: bfrk Date: 2022-04-11.07:31:23
I meant System.FilePath.Posix of course.
msg22962 (view) Author: bfrk Date: 2022-04-11.07:35:32
Updated bundle with the original 2 patches plus 2 new ones.

4 patches for repository http://darcs.net/screened:

patch e71755510f765efe468b916c020c585dd34c7c6f
Author: Maksim Golubev <maksim.golubev72@gmail.com>
Date:   Mon Mar 21 01:42:46 CET 2022
  * fix: cloning to an external repository led to the creation of an extra nested directory

  Before copying the data using the scp command, a remote directory corresponding
  to the new repository is created beforehand to check whether the contents of
  this directory will not be deleted if it already exists. But if you leave this
  directory, the scp command will create another directory inside it. Therefore,
  before executing scp, we will delete the created directory.

patch 49d6f0081d519ff380ba1f03faa9d10ede821571
Author: Maksim Golubev <maksim.golubev72@gmail.com>
Date:   Mon Mar 21 01:49:43 CET 2022
  * fix: try create parent directories when cloning to a remote repository

  When cloning to a remote repository, we are now trying to create the entire
  hierarchy of parent directories if they were missing.

patch 124c0e3c74e7bab229590be9f3806c7ffd539fb8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Apr 10 12:48:59 CEST 2022
  * extend test script for clone to ssh

patch 84f5e74af7c07ed0c8ae8e65c5f14bc1ee3037d3
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Apr 11 09:27:22 CEST 2022
  * clone command: System.FilePath -> System.FilePath.Posix
Attachments
msg22987 (view) Author: bfrk Date: 2022-04-13.21:22:18
A few more follow-up patches, see discussion at issue2673.

3 patches for repository http://darcs.net/screened:

patch d94bc3f043c6e3ee530eba3e96014c0489410af2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Apr 13 13:17:35 CEST 2022
  * clarify the tricky parts of clone to ssh

patch 9065a0fb4f017512546741336e5564496c7207d0
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Apr 13 13:33:37 CEST 2022
  * tests/network/ssh.sh: remove directories before creating them

patch 0f5c38378d19fd9b0a4c4b683dabfe5b18168935
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Apr 13 13:32:59 CEST 2022
  * extend environment help for DARCS_SCP
Attachments
History
Date User Action Args
2022-03-27 19:58:42ki11men0wcreate
2022-04-10 11:16:31bfrksetmessages: + msg22957
2022-04-11 07:26:30bfrksetmessages: + msg22960
2022-04-11 07:31:23bfrksetmessages: + msg22961
2022-04-11 07:35:32bfrksetfiles: + patch-preview.txt, fix_-cloning-to-an-external-repository-led-to-the-creation-of-an-extra-nested-directory.dpatch
messages: + msg22962
2022-04-12 10:36:15bfrksetstatus: needs-screening -> accepted
2022-04-13 21:22:18bfrksetfiles: + patch-preview.txt, clarify-the-tricky-parts-of-clone-to-ssh.dpatch
messages: + msg22987