[darcs-users] Programmatic invocation
Jason Dagit
dagit at eecs.oregonstate.edu
Sat Nov 5 00:05:21 UTC 2005
On Nov 4, 2005, at 3:42 PM, Max Battcher wrote:
> 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, :accep
>> tremaining, 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?
I think this conversation really points out two things about darcs:
1. The repository is a type of database.
2. We would benefit if darcs could be embedded into things (or vice
versa).
So, if darcs could be a library that applications could link into
then a gui could be built that really integrated darcs (even eclipse
is an example). The other way to go with that is to embed a language
in darcs. But, I prefer the idea of making darcs embeddable so that
you can choose your language by making bindings for libdarcs in
<insert favorite language>. This could really open up the door for
making darcs interfaces and using conflict theory in settings besides
revision control (think undo systems like in GIMP).
So....my proposal is for darcs to be an api which includes a way to
perform sql queries on the darcs repo database. Any takers?
Thanks,
Jason
More information about the darcs-users
mailing list