Timothy Brownawell schrieb: > On Mon, Sep 28, 2009 at 6:37 AM, Thomas Keller <[email protected]> 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 | [email protected] | 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
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Monotone-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/monotone-devel
