This proposal is meant as an alternative solution to my gripe with the
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.