threads / patch / 7402

patchpager: default to LESS=FRX not LESS=FRSX

Subject: [PATCH] pager: default to LESS=FRX not LESS=FRSX

## tl;dr

11 messages between Mar 26, 2007 and Mar 27, 2007. Diffs are folded; open one to read it.

replies: 10people: 5as markdown or json

Eygene Ryabinkin· Mar 26, 2007, 07:35 UTC · lore

Remove unnecessary '-S' option that enabled less to chop long lines. It used to provide some confusion at least for the 'git diff': "Where are my long lines? Are they missed from the patch?".

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
---
 pager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to pager.c +1 −1
diff --git a/pager.c b/pager.c
index 5f280ab..2dca00e 100644
--- a/pager.c
+++ b/pager.c
@@ -62,7 +62,7 @@ void setup_pager(void)
 	close(fd[0]);
 	close(fd[1]);
 
-	setenv("LESS", "FRSX", 0);
+	setenv("LESS", "FRX", 0);
 	run_pager(pager);
 	die("unable to execute pager '%s'", pager);
 	exit(255);
-- 
1.5.0.3-dirty
Junio C Hamano· Mar 26, 2007, 08:28 UTC · re: Eygene Ryabinkin · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

Eygene Ryabinkin <rea-git@codelabs.ru> writes:
> Remove unnecessary '-S' option that enabled less to chop long lines.
> It used to provide some confusion at least for the 'git diff':
> "Where are my long lines? Are they missed from the patch?".

It is not "unnecessary", but only "what _you_ are not used to". As this breaks expectentions of people already familiar with what git does by default, I cannot take this patch.

Shawn O. Pearce· Mar 26, 2007, 08:36 UTC · re: Junio C Hamano · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

Junio C Hamano <junkio@cox.net> wrote:
Show 9 quoted lines
> Eygene Ryabinkin <rea-git@codelabs.ru> writes:
> 
> > Remove unnecessary '-S' option that enabled less to chop long lines.
> > It used to provide some confusion at least for the 'git diff':
> > "Where are my long lines? Are they missed from the patch?".
> 
> It is not "unnecessary", but only "what _you_ are not used to".
> As this breaks expectentions of people already familiar with
> what git does by default, I cannot take this patch.

Hear hear. I completely agree with Junio. I (and a number of other users that I work with) expect this behevaior by default.

-- 
Shawn.
Junio C Hamano· Mar 26, 2007, 08:44 UTC · re: Shawn O. Pearce · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 13 quoted lines
> Junio C Hamano <junkio@cox.net> wrote:
>> Eygene Ryabinkin <rea-git@codelabs.ru> writes:
>> 
>> > Remove unnecessary '-S' option that enabled less to chop long lines.
>> > It used to provide some confusion at least for the 'git diff':
>> > "Where are my long lines? Are they missed from the patch?".
>> 
>> It is not "unnecessary", but only "what _you_ are not used to".
>> As this breaks expectentions of people already familiar with
>> what git does by default, I cannot take this patch.
>
> Hear hear.  I completely agree with Junio.  I (and a number of
> other users that I work with) expect this behevaior by default.
Two tips.
 (1) Learn to use left/right arrow keys under "less -S" if you
     have occasional lines that are too long.
 (2) Do not have too many too long lines to begin with.  If you
     cannot comfortably read your code with "less -S", your
     nesting is too deep to be understood with or without line
     folding.
Eygene Ryabinkin· Mar 26, 2007, 10:08 UTC · re: Junio C Hamano · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

Junio,
Mon, Mar 26, 2007 at 01:44:34AM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> > Junio C Hamano <junkio@cox.net> wrote:
> >> Eygene Ryabinkin <rea-git@codelabs.ru> writes:
> >> 
> >> > Remove unnecessary '-S' option that enabled less to chop long lines.
> >> > It used to provide some confusion at least for the 'git diff':
> >> > "Where are my long lines? Are they missed from the patch?".
> >> 
> >> It is not "unnecessary", but only "what _you_ are not used to".
> >> As this breaks expectentions of people already familiar with
> >> what git does by default, I cannot take this patch.
OK, no problem.
Show 7 quoted lines
> > Hear hear.  I completely agree with Junio.  I (and a number of
> > other users that I work with) expect this behevaior by default.
> 
> Two tips.
> 
>  (1) Learn to use left/right arrow keys under "less -S" if you
>      have occasional lines that are too long.

I do not like the left/right keys: it is wery hard to get the right typing speed if we're using the arrow keys. But it is just my habit since I learned to 10 fingers typing.

>  (2) Do not have too many too long lines to begin with.  If you
>      cannot comfortably read your code with "less -S", your
>      nesting is too deep to be understood with or without line
>      folding.

Yes, yes, "if you need more than 4 levels of identation then your code is probably in a bad shape". I know it. But the problem was that I noticed this behaviour when I was patching the Git sources and there were some removed lines that were long enough not to fit to the screen with the addition of the '- ' diff tags.

-- 
Eygene
Junio C Hamano· Mar 26, 2007, 18:45 UTC · re: Eygene Ryabinkin · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

Eygene Ryabinkin <rea-git@codelabs.ru> writes:
Show 7 quoted lines
>> Two tips.
>> 
>>  (1) Learn to use left/right arrow keys under "less -S" if you
>>      have occasional lines that are too long.
>
> I do not like the left/right keys: it is wery hard to get the
> right typing speed ...

Heh, who types 120-word a minute while perusing the source with "less"?

I do not like to move my hand from the home position on the keyboard either, so I never touch arrow keys while I am typing to produce, but I never thought of bothering to reconfigure less keybindings for the reason you stated, as I do not have infinite amount of time.

Jeff King· Mar 26, 2007, 19:03 UTC · re: Eygene Ryabinkin · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

On Mon, Mar 26, 2007 at 02:08:57PM +0400, Eygene Ryabinkin wrote:
> I do not like the left/right keys: it is wery hard to get the
> right typing speed if we're using the arrow keys. But it is just
> my habit since I learned to 10 fingers typing.
You might try:

cat >>$HOME/.lesskey <<'EOF' h left-scroll l right-scroll EOF lesskey

-Peff
Eygene Ryabinkin· Mar 27, 2007, 06:47 UTC · re: Jeff King · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

Jeff, good day.
Mon, Mar 26, 2007 at 03:03:04PM -0400, Jeff King wrote:
Show 13 quoted lines
> On Mon, Mar 26, 2007 at 02:08:57PM +0400, Eygene Ryabinkin wrote:
> 
> > I do not like the left/right keys: it is wery hard to get the
> > right typing speed if we're using the arrow keys. But it is just
> > my habit since I learned to 10 fingers typing.
> 
> You might try:
> 
> cat >>$HOME/.lesskey <<'EOF'
> h left-scroll
> l right-scroll
> EOF
> lesskey
Very good, thanks!
-- 
Eygene
Bill Lear· Mar 26, 2007, 19:14 UTC · re: Junio C Hamano · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

On Monday, March 26, 2007 at 01:44:34 (-0700) Junio C Hamano writes:
Show 20 quoted lines
>"Shawn O. Pearce" <spearce@spearce.org> writes:
>
>> Junio C Hamano <junkio@cox.net> wrote:
>>> Eygene Ryabinkin <rea-git@codelabs.ru> writes:
>>> 
>>> > Remove unnecessary '-S' option that enabled less to chop long lines.
>>> > It used to provide some confusion at least for the 'git diff':
>>> > "Where are my long lines? Are they missed from the patch?".
>>> 
>>> It is not "unnecessary", but only "what _you_ are not used to".
>>> As this breaks expectentions of people already familiar with
>>> what git does by default, I cannot take this patch.
>>
>> Hear hear.  I completely agree with Junio.  I (and a number of
>> other users that I work with) expect this behevaior by default.
>
>Two tips.
>
> (1) Learn to use left/right arrow keys under "less -S" if you
>     have occasional lines that are too long.

Hmm, looking at the code: why, if the environment variable LESS is already set, should this all be worth talking about? Shouldn't the user be able to set LESS to whatever they want, once, and be done with it? The current setenv() call to set up the pager does this, correct?

Bill
Junio C Hamano· Mar 26, 2007, 20:27 UTC · re: Bill Lear · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

Bill Lear <rael@zopyra.com> writes:
Show 26 quoted lines
> On Monday, March 26, 2007 at 01:44:34 (-0700) Junio C Hamano writes:
>>"Shawn O. Pearce" <spearce@spearce.org> writes:
>>
>>> Junio C Hamano <junkio@cox.net> wrote:
>>>> Eygene Ryabinkin <rea-git@codelabs.ru> writes:
>>>> 
>>>> > Remove unnecessary '-S' option that enabled less to chop long lines.
>>>> > It used to provide some confusion at least for the 'git diff':
>>>> > "Where are my long lines? Are they missed from the patch?".
>>>> 
>>>> It is not "unnecessary", but only "what _you_ are not used to".
>>>> As this breaks expectentions of people already familiar with
>>>> what git does by default, I cannot take this patch.
>>>
>>> Hear hear.  I completely agree with Junio.  I (and a number of
>>> other users that I work with) expect this behevaior by default.
>>
>>Two tips.
>>
>> (1) Learn to use left/right arrow keys under "less -S" if you
>>     have occasional lines that are too long.
>
> Hmm, looking at the code: why, if the environment variable LESS is
> already set, should this all be worth talking about?  Shouldn't the
> user be able to set LESS to whatever they want, once, and be done with
> it?  The current setenv() call to set up the pager does this, correct?
Yes.  That would make the third tip ;-).
Eygene Ryabinkin· Mar 27, 2007, 06:54 UTC · re: Bill Lear · lore

Re: [PATCH] pager: default to LESS=FRX not LESS=FRSX

Bill, good day.
Mon, Mar 26, 2007 at 01:14:44PM -0600, Bill Lear wrote:
Show 7 quoted lines
> > (1) Learn to use left/right arrow keys under "less -S" if you
> >     have occasional lines that are too long.
> 
> Hmm, looking at the code: why, if the environment variable LESS is
> already set, should this all be worth talking about?  Shouldn't the
> user be able to set LESS to whatever they want, once, and be done with
> it?  The current setenv() call to set up the pager does this, correct?

If it was named GIT_LESS, then yes, I could set it to the defaults that are sane for me with Git. But I do not like the idea of setting -F, -R and -X for all less invocations. But OK, the 'l' and 'h' bindings for less movements are fine with me. I do not like scrolling very much (using 14400 modem lines sometimes, so it is a bit slow), but if 'FRSX' are good defaults that people are used to, then I should live with them. Or probably start the git-FRX toolchain ;))

OK, I feel that this thread is exhausted itself, so I am shutting up.
-- 
Eygene

← back to recent threads