Re: [PATCH] pager: turn on "cat" optimization for DEFAULT_PAGER

2013-11-20 Thread Erik Faye-Lund
On Wed, Nov 20, 2013 at 6:33 PM, Junio C Hamano wrote: > Erik Faye-Lund writes: > >>> ... >>> is set to empty., 2006-04-16). At that time, the line >>> directly above used: >>> >>>if (!pager) >>>pager = "less"; >>> >>> as a fallback, meaning that it could not possibly trigger >>>

Re: [PATCH] pager: turn on "cat" optimization for DEFAULT_PAGER

2013-11-20 Thread Erik Faye-Lund
On Wed, Nov 20, 2013 at 6:30 PM, Jeff King wrote: > On Wed, Nov 20, 2013 at 06:24:45PM +0100, Erik Faye-Lund wrote: > >> > diff --git a/pager.c b/pager.c >> > index c1ecf65..fa19765 100644 >> > --- a/pager.c >> > +++ b/pager.c >> > @@ -54,7 +54,7 @@ const char *git_pager(int stdout_is_tty) >> >

Re: [PATCH] pager: turn on "cat" optimization for DEFAULT_PAGER

2013-11-20 Thread Junio C Hamano
Erik Faye-Lund writes: >> ... >> is set to empty., 2006-04-16). At that time, the line >> directly above used: >> >>if (!pager) >>pager = "less"; >> >> as a fallback, meaning that it could not possibly trigger >> the optimization. Later, a3d023d (Provide a build time >> default-pa

Re: [PATCH] pager: turn on "cat" optimization for DEFAULT_PAGER

2013-11-20 Thread Jeff King
On Wed, Nov 20, 2013 at 06:24:45PM +0100, Erik Faye-Lund wrote: > > diff --git a/pager.c b/pager.c > > index c1ecf65..fa19765 100644 > > --- a/pager.c > > +++ b/pager.c > > @@ -54,7 +54,7 @@ const char *git_pager(int stdout_is_tty) > > pager = getenv("PAGER"); > > if (!page

Re: [PATCH] pager: turn on "cat" optimization for DEFAULT_PAGER

2013-11-20 Thread Erik Faye-Lund
On Tue, Sep 3, 2013 at 9:41 AM, Jeff King wrote: > On Mon, Sep 02, 2013 at 10:27:48PM -0400, Dale R. Worley wrote: > >> > I guess the "else" could and should be dropped. If you do so (and >> > possibly insert a blank line between the DEFAULT_PAGER case and the >> > "pager = NULL" case), you get a

Re: [PATCH] pager: turn on "cat" optimization for DEFAULT_PAGER

2013-09-03 Thread Junio C Hamano
Jeff King writes: > I'll venture my opinion. We should do this: > > -- >8 -- > Subject: pager: turn on "cat" optimization for DEFAULT_PAGER > > If the user specifies a pager of "cat" (or the empty > string), whether it is in the environment or from config, we > automagically optimize it out to me

[PATCH] pager: turn on "cat" optimization for DEFAULT_PAGER

2013-09-03 Thread Jeff King
On Mon, Sep 02, 2013 at 10:27:48PM -0400, Dale R. Worley wrote: > > I guess the "else" could and should be dropped. If you do so (and > > possibly insert a blank line between the DEFAULT_PAGER case and the > > "pager = NULL" case), you get a nice pattern > > > > if (!pager) > > try_something(