darcs

Issue 1670 apply: supports stdin, so should support FIFOs.

Title apply: supports stdin, so should support FIFOs.
Priority feature Status given-up
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, twb
Assigned To
Topics

Created on 2009-11-01.04:11:21 by twb, last changed 2017-07-30.23:39:08 by gh.

Messages
msg9155 (view) Author: twb Date: 2009-11-01.04:11:08
I wanted to cherry-pick a patch from a bundle, so instead of

    curl URL | darcs apply

I wanted to do this bashism

    darcs apply --interactive <(curl URL)

This fails because Darcs tries to get the size of the file.  It
shouldn't need to, since it can't know the file size when applying
from stdin.

The exact command was

    $ darcs apply --interactive <(curl -s http://bugs.darcs.net/file707/add-an-extra-newline-in-help-text-stored-in-author-prefs_.dpatch)
    darcs: /proc/11409/fd/63: hFileSize: inappropriate type (not a regular file)
msg9184 (view) Author: kowey Date: 2009-11-02.11:23:17
Looks like we need somebody to work out why this fails.  May be worth boiling
this down to a tiny little Haskell script and passing in a named pipe via <

Trent: 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?)
msg9191 (view) Author: twb Date: 2009-11-03.04:01:18
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.
History
Date User Action Args
2009-11-01 04:11:21twbcreate
2009-11-02 11:23:19koweysetpriority: feature
status: unknown -> needs-reproduction
messages: + msg9184
nosy: + kowey
2009-11-03 04:01:23twbsetmessages: + msg9191
2017-07-30 23:39:08ghsetstatus: needs-reproduction -> given-up