[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: Ben Reser <ben_at_reser.org>
Date: Wed, 05 Feb 2014 16:25:39 -0800

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.

> - 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).

> - 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.

> Perhaps the best compromise is to make just 'svn help' use a pager by
> default (so users realise that the auto-paging feature exists), and
> allow users to enable the automatic pager on a per-subcommand basis
> in the configuration file?

I think this is a poor choice. End users using the command line client
interactively are exactly the users who are likely to never change the
defaults. Users that are scripting or automating are exactly the users that
are going to be inclined to change the defaults.

So when you make choices like this. The average user who never bothers to look
at the config options forever ends up typing out the pipe to the pager (or just
being miserable since they don't even do that). While a few advanced users are
slightly less inconvenienced.

Just doesn't seem like a good trade off to me.
Received on 2014-02-06 01:26:02 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.