[darcs-devel] [issue1670] apply: supports stdin, so should support FIFOs.

Trent W. Buck bugs at darcs.net
Tue Nov 3 04:01:23 UTC 2009


Trent W. Buck <trentbuck at gmail.com> added the comment:

On Mon, Nov 02, 2009 at 11:23:19AM +0000, Eric Kow wrote:
> Why didn't you try curl URL | darcs apply -i?  (aside from the fact
> that Darcs wants to read answers to interactive prompts from stdin?,
> but then how would darcs apply -i < fifo been any different?)

Reading from a fifo would be a separate stream to the stdin stream, so
they wouldn't "fight", i.e. darcs could read the patch bundle from the
fifo and separately read my interactive responses from stdin.


In case this isn't clear, consider an analogous case.  Suppose you
want to do "diff foo.c bar.c", but foo and bar are on separate
machines.  You can say

    ssh fs cat foo.c bar.c | diff

But that doesn't make sense, because diff needs to access TWO streams.

Instead you could say

    diff <(ssh fs cat foo.c) <(ssh fs cat bar.c)

and diff will happily compare these two separate incoming streams.

Because diff isn't using the stdin stream, you could also say

    ssh fs cat foo.c | diff - <(ssh fs cat bar.c)

which in which the incoming foo.c is analogous to my answers to apply
--interactive prompts, and bar.c is analogous to the patch bundle.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1670>
__________________________________


More information about the darcs-devel mailing list