[darcs-devel] darcs robot command

David Roundy droundy at darcs.net
Thu Aug 2 09:56:54 PDT 2007


On Thu, Aug 02, 2007 at 03:35:50AM -0700, Ben Coburn wrote:
> Some thinking out loud regarding command aliasing and driving darcs  
> with external code....
> 
> Instead of "tacking on" XML output to more commands, maybe it would  
> be better to have a command for driving darcs with bi-directional XML  
> messages.

One question would be whether this is actually preferable to a libdarcs.
It's almost certainly more effort, probably harder to get right, and
possibly less powerful and harder to use.

But I suppose that's just me being pessimistic.  Mostly because many people
have asked for something like this, but such a daemon mode would be
unlikely to be useful without an actual user participating in the
development process, and noone has yet volunteered to work on anything like
this.

Adding XML output to an existing command is generally pretty easy, you just
use a different print function, and XML is easy to generate and hard to
parse, so outputting it is pretty easy.

> For example, 'darcs robot record' might...
> 1) Send a blank "patch info" structure waiting to be filled in and a  
> big list of things available to record (where each thing has a record  
> property set to false).
> 2) Parse the returned XML structure for the patch name, comment, etc.  
> and record all the things that had their record property changed to  
> true.

Except that this won't work:  you'd need a loop in which the caller selects
and de-selects changes, with darcs responding with information about which
other patches also had their selection modified.  Darcs itself uses a
tri-state switch for each change, so you'd either need to use that or
resign yourself to a less-powerful interface than the human-interaction
one.

(e.g. consider what we should do when asked to record a modification to a
new file, but not the addition of that file... which of those two requests
should we ignore?)

> P.S. Should I file things like this through the "bug tracker"? It's  
> not exactly a feature request, just something I think people may want  
> to think about.

You could send wish-list items to the bug tracker, but if you are hesitant
as to whether it's actually a good idea, then sending it to the list first
would make more sense.
-- 
David Roundy
Department of Physics
Oregon State University


More information about the darcs-devel mailing list