[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1422706 - in /subversion/trunk/subversion: libsvn_subr/opt.c tests/cmdline/svntest/main.py

From: Branko Čibej <brane_at_wandisco.com>
Date: Mon, 17 Dec 2012 21:14:42 +0100

On 17.12.2012 20:44, Peter Samuelson wrote:
> [Stefan Sperling]
>> We could use iatty() to enable --non-interactive if output is not
>> going to a terminal, for instance.
> I floated this idea some time ago and I'm still in favor of it. But I
> think a simple isatty(STDERR_FILENO) would be wrong. What you want is
> to detect that there is a controlling terminal at all - something like:
>
> #if WINDOWS
> #define CON "CON:"
> #else
> #define CON "/dev/tty"
> #endif
> fd = open(CON, O_RDWR);
> if (fd >= 0) {
> close(fd);
> ...
> }
>
> (Of course I have no idea if "CON:" behaves that way. But there must
> be _some_ way to determine, on Windows, whether you have a terminal
> window available.)
>
> Someone - was it Mark, perhaps? - objected to this idea on the basis
> that some wrapper programs out there may try to "scrape" the prompts,
> in interactive mode, and supply the correct input from, e.g., GUI
> dialog boxes.
>
> I feel like that's a blatant abuse of our interfaces and we shouldn't
> support it, and if anyone really needs to do that they should use
> 'expect', but that's just an opinion and it isn't (yet) backed with any
> code.

That "blatant abuse" happens at least in two places that I'm aware of:
our tests, and Emacs vc-mode.

And we'd hardly go to the trouble of keeping the command-line output
backwards-compatible if we didn't /expect/ people to drive svn this way.

-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com
Received on 2012-12-17 21:15:17 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.