Issue 2610 add --inherit-default option for clone, push, pull, send etc

Title add --inherit-default option for clone, push, pull, send etc
Priority feature Status resolved
Milestone Resolved in 2.14.3 STABLE
Superseder Nosy List bf
Assigned To

Created on 2018-11-19.17:25:13 by bf, last changed 2019-08-06.09:42:54 by noreply.

msg20531 (view) Author: bf Date: 2018-11-19.17:25:10
This proposal is meant as an alternative solution to my gripe with the
set-default hint.

To explain why I find it annoying and useless, here is my standard

For each project I work on, I have a number of repos that are all
branches of the same upstream, usually all of them in the same
project-specific directory. I never set the defaultrepo to anything
other than this single upstream, which means I have to do a 'darcs pull
<upstream> --set-default' at least once after making a clone locally. I
push and pull a lot between my local branches and I always do that
explicitly which means I get the set-default hint all the time and it is
completely useless to me.

The reason I work like this is quite simple: when I have more than, say,
three branches, it becomes very hard to remember which branch has which
other branch as defaultrepo. Whenever I forget to set the defaultrepo
back to the upstream I become completely confused when I do e.g. 'darcs
send --dry-run' and get a response completely different from what I

Clearly different people have different preferences. My proposal is thus:

A new option --inherit-default, designed to support a work-flow along
the lines described above, with the following semantics:

For clone: if the source repo has a defaultrepo set, inherit that,
otherwise set it to the source repo as usual.

For push, pull, and send (and rebase push and pull etc): change the
meaning of --set-default to refer to the defaultrepo of the remote repo,
rather than the remote repo itself. Again, do this only if the remote
repo actually has a default repo set, other wise behave as usual. This
would include the way the set-default hint is displayed: it would then
be displayed (in suitably modified form) if the remote repo has a
defaultrepo set /and/ it differs from what we have set locally.

Informally, --inherit-default tells Darcs that this (meaning: the target
for clone, the local repo for the other commands) is yet another branch
of the same upstream.

I could add 'All --inherit-default' to my global defaults and (1) get
rid of the set-default hint when it is useless for me but retain it when
it is helpful (2) avoid having to reset the defaultrepo to upstream

A possible extension would be to inherit not only the default repo but
also other repo specific setting e.g. the defaults.
msg20560 (view) Author: ganesh Date: 2018-11-26.18:24:24
This makes a lot of sense for 'clone'. The semantics for other
commands feel a bit convoluted to me in isolation, but make
sense in conjunction with the semantics for clone.
msg21040 (view) Author: noreply Date: 2019-08-06.09:42:52
The following patch sent by Ben Franksen <ben.franksen@online.de> updated issue issue2610 with
status=resolved;resolvedin=2.15.0 HEAD

* resolve issue2610: add --inherit-default option 
Ignore-this: c5dbfeb384a794d113fa1394e0b71e0c22a1d5460b9cd96ab125b6de350dfe2a36f7885478bf3a33
Date User Action Args
2018-11-19 17:25:13bfcreate
2018-11-26 18:24:26ganeshsetmessages: + msg20560
2019-08-06 09:42:54noreplysetstatus: unknown -> resolved
messages: + msg21040
resolvedin: 2.14.3 STABLE