[darcs-users] Programmatic invocation

Max Battcher me at worldmaker.net
Fri Nov 4 23:42:29 UTC 2005


Jonathon Mah wrote:
> 
> There could be a character such as ':' that would trigger a 
> "machine-input" or "long-input" mode, which accepts long command names 
> which never change. So something like this:
> 
> Shall I record this patch? (etc.): :accept
>           (user input starts here) ^
> 
> Other commands could be :reject, :wait, :rejectfile, :acceptfile, 
> :rejectremaining, :acceptremaining, and so on. This would allow the 
> human shortcuts to change whilst maintaining compatibility with scripts.
> 
> 
> When machine-friendliness is implemented (with whichever method), one 
> thing _must_ be present right from the beginning: a version flag. That 
> is, 'darcs record --command-set=1'. This will allow two things:
> 1)  The command set can be changed in the future whilst retaining 
> backward compatibility with existing scripts (by keeping compatibility 
> code for old command sets).
> 2)  Backward compatibility could be broken (I'm thinking very far into 
> the future), and asking for an old command set would generate an error. 
> This is obviously infinitely more desirable than accepting some old 
> commands and silently failing on others.
> 

This is an interesting solution.  Verbose enough to keep too many future 
changes from impacting current applications, but simple enough that even 
a human can use it.  Basically, to me it seems like a fairly decent 
compromise from the XML input idea.

One of the things that I was thinking about when I suggested XML inputs, 
and that your idea makes seem even more useful, is that darcs could add 
a script-mode where it can access multiple commands at once.  In the 
case of using something like :commands (which is nicely reminiscent of 
vim command mode) the script-mode becomes a mini-shell, which is 
interesting.

Based upon your suggestions:

darcs shell
 >> record :accept :reject
Some changes to a.txt
 >> record :accept
Some more changes to a.txt
 >> add somefile.txt
 >> record -a
Added somefile
 >> push :accept :accept :rejectfile

Of course, I keep joking that what darcs really needs is something of a 
small query language.  SQL for Darcs, anyone?

-- 
--Max Battcher--
http://www.worldmaker.net/
"History bleeds for tomorrow / for us to realize and never more follow 
blind" --Machinae Supremacy, Deus Ex Machinae, Title Track




More information about the darcs-users mailing list