Created on 2011-02-23.06:40:26 by bsrkaditya, last changed 2011-04-01.13:20:25 by ganesh.
See mailing list archives
for discussion on individual patches.
msg13743 (view) |
Author: bsrkaditya |
Date: 2011-02-23.06:40:25 |
|
1 patch for repository http://darcs.net/screened:
Wed Feb 23 11:40:17 IST 2011 bsrkaditya@gmail.com
* resolve issue1648: darcs now uses tty instead of stdin in promptChar
I have modified promptChar, to use terminal instead of stdin.
I grepped through the source files for promptChar, and always,
promptChar is used for interactive input (mostly yn questions).
BTW, is interactive mode input limited to only menu choices?
If so, then the issue is resolved.
Attachments
|
msg13744 (view) |
Author: bsrkaditya |
Date: 2011-02-23.06:58:26 |
|
1 patch for repository http://darcs.net/screened:
Wed Feb 23 12:13:22 IST 2011 bsrkaditya@gmail.com
* resolve issue1648: darcs now uses tty instead of stdin in interactive modes
preferTerm has not been imported in the previous patch
use this one instead
Attachments
|
msg13748 (view) |
Author: bsrkaditya |
Date: 2011-02-24.07:52:59 |
|
I have ran the tests using 'cabal test',
and apparently my change completely messes up
the system used for writing tests.
The tests use echo and then pipes to give input to
interactive statements. For example,
echo y | darcs amend -a foo
So, if this patch needs to be accepted, we need a
complete rewrite of the tests.
Or maybe it is better if we can somehow signal to darcs
on weather to use tty or stdin?
Regular users use tty, but in scripts we can use stdin.
|
msg13749 (view) |
Author: ganesh |
Date: 2011-02-24.08:42:35 |
|
I can't see how the tests could sensibly be rewritten. So we'd need a flag
to control this behaviour.
Are there any use cases for it other than darcs apply --interactive?
|
msg13750 (view) |
Author: bsrkaditya |
Date: 2011-02-24.10:17:38 |
|
On Thu, Feb 24, 2011 at 2:12 PM, Ganesh Sittampalam <bugs@darcs.net> wrote:
>
> Ganesh Sittampalam <ganesh@earth.li> added the comment:
>
> Are there any use cases for it other than darcs apply --interactive?
>
>
Yes, promptChar is used to take input in questions
where user is supposed to give input as a single char.
So this change effects it to all commands which prompt
the user, like darcs record, which asks the user:
Shall I record this change? (1/1) [ynW...], or ? for more options:
> __________________________________
> Darcs bug tracker <bugs@darcs.net>
> <http://bugs.darcs.net/patch561>
> __________________________________
>
--
BSRK Aditya
Attachments
|
msg13751 (view) |
Author: ganesh |
Date: 2011-02-24.10:35:04 |
|
Is that behaviour useful in any case other than apply --interactive? The
use case in issue1648 is piping a bunch of patches in a patch file into
darcs apply and wanting to be able to select from those patches
interactively. What other scenarios are there where darcs needs those
two input streams, one of data from stdin and another of user
interaction from tty?
|
msg13752 (view) |
Author: kowey |
Date: 2011-02-24.11:33:01 |
|
On Thu, Feb 24, 2011 at 08:42:36 +0000, Ganesh Sittampalam wrote:
> I can't see how the tests could sensibly be rewritten. So we'd need a flag
> to control this behaviour.
Is it technically feasible to have some kind of command, let's call it
fake-terminal, that runs a command, accepts input on stdin and pretends
to that command that the input was typed in?
echo yn | fake-terminal darcs ...
Is something like Expect what I'm thinking of?
http://en.wikipedia.org/wiki/Expect
Could we "just use expect"? (That sounds like it'd involve a lot of
exit 200) or cook up a really brain-dead version?
(Perhaps I misunderstand the issue)
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, try +44 (0)1273 64 2905 or
xmpp:kowey@jabber.fr (Jabber or Google Talk only)
|
msg13757 (view) |
Author: ganesh |
Date: 2011-02-24.23:06:55 |
|
On 24/02/2011 11:22, Eric Kow wrote:
> On Thu, Feb 24, 2011 at 08:42:36 +0000, Ganesh Sittampalam wrote:
>> I can't see how the tests could sensibly be rewritten. So we'd need a flag
>> to control this behaviour.
>
> Is it technically feasible to have some kind of command, let's call it
> fake-terminal, that runs a command, accepts input on stdin and pretends
> to that command that the input was typed in?
>
> echo yn | fake-terminal darcs ...
>
> Is something like Expect what I'm thinking of?
> http://en.wikipedia.org/wiki/Expect
>
> Could we "just use expect"? (That sounds like it'd involve a lot of
> exit 200) or cook up a really brain-dead version?
>
> (Perhaps I misunderstand the issue)
Ah, good point. We probably could do something like that.
But we'd also be breaking anyone trying to use the darcs binary
programmatically in some way. If the only benefit is for apply
--interactive, I think we shouldn't do that; providing a flag should
work fine for that scenario.
Ganesh
|
|
Date |
User |
Action |
Args |
2011-02-23 06:40:26 | bsrkaditya | create | |
2011-02-23 06:58:26 | bsrkaditya | set | files:
+ unnamed, resolve-issue1648_-darcs-now-uses-tty-instead-of-stdin-in-interactive-modes.dpatch, unnamed messages:
+ msg13744 title: resolve issue1648: darcs now uses tty instead of stdin... -> darcs now uses tty instead of stdin in promptChar |
2011-02-24 07:52:59 | bsrkaditya | set | messages:
+ msg13748 |
2011-02-24 08:42:35 | ganesh | set | messages:
+ msg13749 |
2011-02-24 10:17:38 | bsrkaditya | set | files:
+ unnamed messages:
+ msg13750 |
2011-02-24 10:35:05 | ganesh | set | messages:
+ msg13751 |
2011-02-24 11:33:01 | kowey | set | messages:
+ msg13752 |
2011-02-24 23:06:56 | ganesh | set | messages:
+ msg13757 |
2011-04-01 11:09:28 | ganesh | set | assignedto: ganesh nosy:
+ ganesh |
2011-04-01 13:20:25 | ganesh | set | status: needs-review -> obsoleted superseder:
+ resolve issue1648: darcs now uses tty instead of stdin in darcs apply --interactive |
|