Control: clone 909124 -2
Control: severity -2 normal
Control: retitle -2 quilt: don't set QUILT_PAGER=less when $LESS is set
Control: tags -2 upstream
Control: found -2 0.66-2.1
Control: tags 909124 upstream patch
Control: found 909124 0.66-2.1
Control: severity 909124 minor
Trent W. Buck wrote on Thu, Mar 17, 2022 at 18:43:20 +1100:
> Trent W. Buck wrote:
> > +++ b/usr/share/quilt/scripts/patchfns
> > @@ -1111,7 +1111,7 @@ setup_pager()
> > - QUILT_PAGER=${QUILT_PAGER-${GIT_PAGER-${PAGER-less -R}}}
> > + QUILT_PAGER=${QUILT_PAGER:-${GIT_PAGER:-${PAGER:-less -R}}}
Thanks. I'm posting a patch for this bug (#909124 == #-1), and bumping
it to "minor" after re-reviewing
<https://www.debian.org/Bugs/Developer#severities>.
[[[
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -1111,7 +1111,7 @@ setup_pager()
# QUILT_PAGER = QUILT_PAGER | GIT_PAGER | PAGER | less -R
# NOTE: QUILT_PAGER='' is significant
- QUILT_PAGER=${QUILT_PAGER-${GIT_PAGER-${PAGER-less -R}}}
+ QUILT_PAGER=${QUILT_PAGER-${GIT_PAGER-${PAGER-/usr/bin/sensible-pager}}}
[ -z "$QUILT_PAGER" -o "$QUILT_PAGER" = "cat" ] && return 0
]]]
More below.
> FAILS: env PAGER=cat quilt series
> WORKS: env -u LESS PAGER=cat quilt series
>
>
> This is actually a separate but related bug in quilt.
> If $LESS is set, quilt ignores $PAGER and forces less.
> This is wrong.
⋮
> 18:38 <REDACTED> [ -n "$LESS" -a -z "${QUILT_PAGER+x}" ] && QUILT_PAGER="less
> -FRX"
Agreed. If Alice normally uses «export PAGER=less LESS=S» and then sets
PAGER=foo, that's the pager quilt shoult use.
Cloned as -2. The above patch does _not_ fix it.
> If quilt wants to override the user's requested $LESS,
> it should do so with "export LESS=FRX",
> entirely independent of $QUILT_PAGER'.
This particular approach would be lossy: it would overwrite the user's
value of $LESS. Instead, quilt could _append_ to $LESS, or pass -R into
less(1)'s argv, or only use $LESS as a hint if PAGER and GIT_PAGER are
also unset and less(1) is installed, or document that the user should
configure their $PAGER / $LESS / $QUILT_PAGER envvars with -R, or…
Cheers,
Daniel
P.S. «sed -i s/Upstream-status/Forwarded/ debian/patches/check_SERIES_exists»
would make that patch's headers compatible with DEP-3 parsers.
> 18:32 <twb> And for comparison, "PAGER=cat git diff" *is* working for git in
> the same environment.
> 18:32 <twb> I wonder if quilt is getting confused because $HOME doesn't exist?
> 18:33 <twb> Nope. But "env -i PAGER=cat quilt series" behaves
> 18:34 <REDACTED> Bizarre...
> 18:36 <twb> Get Fucked.
> 18:36 <twb> env -u LESS fixes it
> 18:36 <REDACTED> But why?
> 18:37 <twb> because quilt is broken I guess
> 18:37 <twb> $LESS should be read by less(1), not by quilt(1)
> 18:38 <REDACTED> [ -n "$LESS" -a -z "${QUILT_PAGER+x}" ] && QUILT_PAGER="less
> -FRX"
> 18:38 <REDACTED> Ugh.
> 18:39 <REDACTED> "env" didn't show anything, because it wasn't exported. We
> should have used "set" instead.
>