[darcs-users] Adding a 'last regrets' question after patch selection

Florent Becker florent.becker at ens-lyon.org
Sat Oct 11 12:28:23 UTC 2008

Hi all,

our patch selection mechanism is very fine, but I feel it should give a
'last exit before hell question' at the end, so that you can review your
patch selection before commiting to whatever action it is you're
doing. Let me explain: suppose you are sending to a repository. You have
three new patches: a b c, with c depending on b. You will have the
following interaction with darcs:

 'do you want to send a?' -> y
 'do you want to send b?' -> n
 'congratulations, you've sent a alone.' -> wtf?

This is especially frustrating and error-prone if b and c are big
patches with subtle dependencies. One answer is to use 'w', but it is
not satisfying: you are offering darcs the power to select patches for
you, but you forfeit the occasion to see which patches you will
effectively send/push/pull/… There again, if you're not sure about
dependencies between patches, this is very error prone and confusing.

That's why i propose to add a question after the last patch has been
selected, as follows:

do you want to <verb> these <things>? [ynvpsrm]

y: yes, go on
n: no, cancel
v: view
p: view in a pager
s: write the output of v to a file and quit
r: restart the selection process
m: modify the selection

m is hard to implement, but as a first approximation, we could just go
back to the last patch question and let the user use j/k.

s would be very powerful coupled with a --read-selection-from-file
flag. You could then save your selection to a file and edit it to
fine-tune it. In particular, in record, this would allow you to split

Commands could add more specialized answers to that question: for
example, send could propose to edit the mail, or cc: someone, and so on.

Of course the problem is that this would change darcs' interactive ui
and break any scripts that interact with it (in particular our shell
tests). We could also add a --cautious/--reckless flag pair, but i'm not
too keen on adding many flags, especially when --reckless would probably
not be that useful out of existing scripts (you save one 'y', if it
counts for you, you're not using the interactive ui, are you?). What do
you think? Change the ui, add a flag, do nothing, something else?

More information about the darcs-users mailing list