darcs

Patch 1841 resolve issue2610: add --inherit-default... (and 1 more)

Title resolve issue2610: add --inherit-default... (and 1 more)
Superseder Nosy List bf
Related Issues
Status accepted Assigned To bf
Milestone

Created on 2019-06-17.13:45:04 by bf, last changed 2019-08-26.11:59:22 by ganesh.

Files
File name Status Uploaded Type Edit Remove
fill-in-the-placeholder-_issuexxxx_-with-a-proper-reference.dpatch bf, 2019-08-14.09:58:00 application/x-darcs-patch
patch-preview.txt bf, 2019-06-18.20:23:29 text/x-darcs-patch
patch-preview.txt bf, 2019-07-07.17:30:43 text/x-darcs-patch
patch-preview.txt bf, 2019-08-14.09:58:00 text/x-darcs-patch
resolve-issue2610_-add-__inherit_default-option.dpatch bf, 2019-06-18.20:23:29 application/x-darcs-patch
resolve-issue2610_-add-__inherit_default-option.dpatch bf, 2019-07-07.17:30:43 application/x-darcs-patch
unnamed bf, 2019-06-18.20:23:29 text/plain
unnamed bf, 2019-07-07.17:30:43 text/plain
unnamed bf, 2019-08-14.09:58:00 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg20849 (view) Author: bf Date: 2019-06-17.13:45:04
2 patches for repository /home/ben/src/darcs/sent:

patch 709965fe05a51166c71bba0870c84a3a5de9eab5
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Jun 17 15:15:25 CEST 2019
  * resolve issue2610: add --inherit-default option

patch 005ad8a944052a3b2ce4832298d81f624d63b114
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Jun 17 13:57:29 CEST 2019
  * remove defunct --set-default option for rebase pull
  
  The option was never honored by this command.
Attachments
msg20858 (view) Author: bf Date: 2019-06-18.18:16:53
Not screening this one immediately to give room for further design 
discussions. You may want to apply and look at the help output and/or 
the test script.

Note that there is currently the limitation that --inherit-default works 
only for local repositories (using isValidLocalPath). As explained in a 
comment in the code this is due to darcs/prefs/defaultrepo being treated 
as a text file, so we cannot reliably read it from a remote location 
(the URL/path may be encoded differently). I think this is okay for the 
intended use case (multiple local branches of a common upstream repo). 
Instead of treating it as a TODO comment I should document it in the 
help text. (I wrote that before I started to actually implement the 
feature).
msg20860 (view) Author: bf Date: 2019-06-18.20:23:29
Amended patch with improved help texts.

1 patch for repository /home/ben/src/darcs/sent:

patch d6decfee86649feea8be7503f7851fb461a97cf3
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Jun 17 15:15:25 CEST 2019
  * resolve issue2610: add --inherit-default option
Attachments
msg20892 (view) Author: bf Date: 2019-07-07.17:30:43
Updated bundle that includes a patch to further enhance security of the
feature.

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

patch d6decfee86649feea8be7503f7851fb461a97cf3
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Jun 17 15:15:25 CEST 2019
  * resolve issue2610: add --inherit-default option

patch ccaf002fd1ce38b981d55c08d1f0ce52364d1acb
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Jun 18 23:27:34 CEST 2019
  * enhance security of --inherit-default
  
  We now check that the remote repo (dir) has the same owner as ".", reducing
  the danger of using a corrupt defaultrepo due to encoding mismatches between
  the remote and local repo.
Attachments
msg21024 (view) Author: ganesh Date: 2019-08-05.13:27:02
> enhance security of --inherit-default

> hunk ./src/Darcs/Repository/Prefs.hs 502
[...]
> -- therefore encoded in the user's locale encoding. See issueXXXX 

issueXXXX should be updated :-)

To be honest I find the behaviour quite obscure/specialised, but I 
don't have any major objections if it makes a significant difference 
to your own workflows. I can't immediately think of anything cleaner 
that achieves the same goals.
msg21099 (view) Author: bf Date: 2019-08-14.09:58:00
Following up on review.

1 patch for repository http://darcs.net/screened:

patch 73d62183964597fa2d4a4c84541eca4bb53314b0
Author: Ben Franksen <ben.franksen@online.de>
Date:   Wed Aug 14 11:59:35 CEST 2019
  * fill in the placeholder "issueXXXX" with a proper reference
Attachments
msg21100 (view) Author: bf Date: 2019-08-14.10:12:18
>> enhance security of --inherit-default
> 
>> hunk ./src/Darcs/Repository/Prefs.hs 502
> [...]
>> -- therefore encoded in the user's locale encoding. See issueXXXX 
> 
> issueXXXX should be updated :-)

Thanks for catching that one. I sent a patch that fills in the placeholder.

> To be honest I find the behaviour quite obscure/specialised, but I 
> don't have any major objections if it makes a significant difference 
> to your own workflows. I can't immediately think of anything cleaner 
> that achieves the same goals.

Adding in-repo branches could be a cleaner solution. The only problem
with such branches, if realised in the traditional way, is that we still
have only one working tree. This is often awkward, as switching between
branches then means we have to re-compile and cannot easily use external
tools to compare the branches. Perhaps, when we add branches to Darcs,
we should deviate from the traditional model and allow multiple working
trees for the different branches?

Anyway, for the moment I am satisfied with this work-around. We can
always delete it if we find a better solution.
History
Date User Action Args
2019-06-17 13:45:04bfcreate
2019-06-18 18:16:53bfsetmessages: + msg20858
2019-06-18 20:23:29bfsetfiles: + patch-preview.txt, resolve-issue2610_-add-__inherit_default-option.dpatch, unnamed
messages: + msg20860
2019-06-18 20:23:46bfsetfiles: - patch-preview.txt
2019-06-18 20:24:05bfsetfiles: - resolve-issue2610_-add-__inherit_default-option.dpatch
2019-06-18 20:24:08bfsetfiles: - unnamed
2019-07-07 17:30:43bfsetfiles: + patch-preview.txt, resolve-issue2610_-add-__inherit_default-option.dpatch, unnamed
messages: + msg20892
2019-07-19 08:46:17bfsetstatus: needs-screening -> needs-review
2019-08-05 13:27:02ganeshsetstatus: needs-review -> accepted-pending-tests
messages: + msg21024
2019-08-06 11:01:35ganeshsetstatus: accepted-pending-tests -> followup-requested
assignedto: bf
2019-08-14 09:58:01bfsetfiles: + patch-preview.txt, fill-in-the-placeholder-_issuexxxx_-with-a-proper-reference.dpatch, unnamed
messages: + msg21099
2019-08-14 10:12:18bfsetmessages: + msg21100
2019-08-15 23:37:31ganeshsetstatus: followup-requested -> (no value)
2019-08-16 15:03:07ganeshsetstatus: accepted-pending-tests
2019-08-26 11:59:22ganeshsetstatus: accepted-pending-tests -> accepted