[darcs-users] [darcs-devel] [issue1648] darcs apply -i <foo.dpatch is wrong
Trent W. Buck
twb at cybersource.com.au
Mon Oct 12 08:59:31 UTC 2009
Judah Jacobson <judah.jacobson at gmail.com> writes:
> On Sun, Oct 11, 2009 at 8:16 AM, Eric Kow <kowey at darcs.net> wrote:
>> On Sun, Oct 11, 2009 at 08:02:33 +0000, Trent W. Buck wrote:
>>> When "apply interactive" is in ~/.darcs/defaults, patches cannot be
>>> read from standard input. This breaks workflows in e.g. mutt.
> Is the workflow essentially "mutt <args> | darcs apply" in the bash
> shell? If not, can you elaborate?
No, I'm reading an incoming "darcs patch:" email in mutt. Then I hit
"v" to view attachments, select the .dpatch attachment, and type
| darcs apply --repo /foo/bar/baz
Where the "|" is a mutt command for "pipe this object into", similar to
Emacs' M-|. If "apply interactive" is in my .darcs/defaults, darcs
apply gets confused.
> You can read directly from the terminal by opening "/dev/tty".
Hmm... is it *always* /dev/tty? I thought it was e.g. /dev/pts/73
> This seems like something Haskeline could conceivably do; namely, when
> stdin isn't a terminal, read from /dev/tty instead of stdin. However,
> usually we really do want to read from stdin; a couple examples are
> testing (as you mentioned) and running in the emacs shell.
Agreed; I'm thinking this would be a special case that is triggered iff
peeking stdin yields the EOF object.
> The real trick is figuring out what the user wants you to do.
> 1) Query an environmental flag (e.g. HASKELINE_FORCE_TTY).
> 2) Add a parameter to one of Haskeline's functions. I'm a little wary
> of this since it changes the API, and as I said before you can't
> always automatically detect whether the user wants tty or stdin.
I don't need this fixed anytime soon. I just need it fixed before
"darcs changes" and "darcs apply" get --interactive by default :-)
More information about the darcs-users