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

Re: [PATCH] pager support for command line client

From: Branko Čibej <brane_at_wandisco.com>
Date: Thu, 06 Feb 2014 09:26:08 +0100

On 06.02.2014 01:25, Ben Reser wrote:
> On 2/5/14, 1:55 PM, Stefan Sperling wrote:
>> Some problems I've been observing are:
>>
>> - Error messages are hidden by the pager even if the svn command
>> produces no other output. This can be fixed for many cases by
>> starting the pager as late as possible (e.g. before the subcommand
>> really starts doing work). But not for all cases. I'm not sure what
>> to do here. Perhaps we should pipe stderr to the pager as well?
> I think copying stderr to the pager as well is the right thing to do.

Agreed.

>> - Scripted svn commands (e.g. svn update) that produce more than a
>> screenfull of output wait for the user to close the pager (arguably, the
>> --non-interactive option should be passed by scripts, but the automatic
>> pager can break existing scripts that don't pass this options).
>> Of course, I made sure the pager isn't started if stdout is not a
>> terminal, but many automated scripts are run in a terminal (e.g. builds).
> Scripts have a couple options:
>
> 1) Disable it entirely via config file.
> 2) Unset the PAGER and SVN_PAGER environment variables if they exist.
> 3) Add --non-interactive (I think we should have a --no-pager option as well).

Please, not another command-line option that's an alias for something we
already do. --config-option:config:pager= should be enough. "env
SVN_PAGER= PAGER=" also works.

If we add --no-pager, we may as well add --no-editor, and I hope we can
agree that doesn't make any sense.

>> - If no output is produced the entire screen is cleared anyway (I
>> believe this happens with git, too). This behaviour is probably
>> pager-specific.
> This is resolved with less by using -FX. I think this is just a matter of
> people configuring their pagers appropriately. If they don't have a pager that
> handles this the way they want then they can get one or they can simply turn
> the whole thing off.
>
>> Ultimately, I'd be much happier with a default behaviour where commands
>> that *I* usually pipe into a pager would use an automatic pager during
>> interactive use. I would guess that this applies to almost everyone.
>> The question then becomes which commands people usually pipe to a
>> pager as a matter of habit. Should we try to make such a list or not?
> Well I gave my list. I obviously think we should use some sort of list and
> that it should be configurable per command because I don't think we'll ever all
> agree on which commands should have it. Also your preference may depend on
> your pager. If you're using a pager like less with -FX you may be much more
> inclined to have it turned on everywhere as opposed to someone using a pager
> that clears the screen and ends up being bothersome to them.

There's such a thing as having too many configuration knobs. I prefer a
static list.

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2014-02-06 09:26:50 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.