mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
pager: move pager-specific setup into the build
Allowing PAGER_ENV to be set at build-time allows us to move pager-specific knowledge out of our build. This allows us to set a better default for FreeBSD more(1), which pretends not to understand ANSI color escapes if the MORE environment variable is left empty, but accepts the same variables as less(1) Originally-from: https://public-inbox.org/git/xmqq61piw4yf.fsf@gitster.dls.corp.google.com/ Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
08df31eecc
commit
995bc22d7f
@@ -160,9 +160,11 @@ git_pager() {
|
||||
else
|
||||
GIT_PAGER=cat
|
||||
fi
|
||||
: "${LESS=-FRX}"
|
||||
: "${LV=-c}"
|
||||
export LESS LV
|
||||
for vardef in @@PAGER_ENV@@
|
||||
do
|
||||
var=${vardef%%=*}
|
||||
eval ": \"\${$vardef}\" && export $var"
|
||||
done
|
||||
|
||||
eval "$GIT_PAGER" '"$@"'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user