monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] merging branch to allow 'automate stdio' over the n


From: Thomas Keller
Subject: Re: [Monotone-devel] merging branch to allow 'automate stdio' over the network
Date: Tue, 29 Sep 2009 16:20:30 +0200
User-agent: Thunderbird 2.0.0.22 (X11/20090605)

Timothy Brownawell schrieb:
> On Mon, Sep 28, 2009 at 6:37 AM, Thomas Keller <address@hidden> wrote:
>>> Timothy Brownawell wrote:
>>>> I think branch net.venge.monotone.tbrownaw.serve_automate.single_port
>>>> is ready for merging. Instead of putting raw 'automate stdio' on the
>>>> network, this encapsulates it as netcmds and keeps the same initial
>>>> negotiation/authentication sequence (and the same 'bye' sequence) as
>>>> netsync.
>> What also came into my mind was this: Instead of having a command
>>
>>        automate remote_stdio
>>
>> why not have a --remote option pointing to a server which should execute
>> the particular command?
>>
>> As far as I can see you find and execute automate commands over the
>> command_id machinery, shouldn't this be possible for "normal"
>> non-automate commands as well?
> 
> Automate commands get a special std::ostream to write to, while normal
> commands use P() or std::cout. So while you could execute normal
> commands, there's no way to capture any output.

...if we wouldn't rewrite all other commands to write to a special
std::ostream just like automate does today, right? I've read something
that it seems to be possible to swap the underlying std::ostream of
std::cout with your own one: http://www.mr-edd.co.uk/?p=16.

See, my main fear is that we eventually start to "duplicate" cli
commands which read "remote_stdio", "remote_tags", "remote_whatever"...

>> If we wanted to implement "ls remote_branches" now we'd probably have to
>> do that as a custom lua command which itself calls into automate somehow
>> - wouldn't it be nice to just say
>>
>>        ls branches --remote my.netsync.server
>>
>> or
>>
>>        automate stdio --remote my.netsync.server
>>
>> ?
> 
> For the particular case of "ls branches" there's already an "automate
> branches" that can be used.

Ok, right, but the main point is: automate's output is for implementors
only and therefor less likely subject to change or even to localize, so
real "remote database functionalities" implemented like this feel like a
hack.

> Maybe it would be worthwhile to add an "automate remote <command>
> <args>" that would run a single automate command remotely and return
> the raw output (without the "automate stdio" packetization)?

This at least would allow us to easily create further "syntactic sugar"
custom commands via automate_lua.

-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]