Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-05 09:27:04 +0300
committerJunio C Hamano <gitster@pobox.com>2010-03-05 09:27:04 +0300
commit6914c661c3652e22fc2971bfefd36fddad56233a (patch)
tree7ea31eb6ed4e6a2fb0882f49db0c46cd19671e77 /git-sh-setup.sh
parent712d352577012d5035da69bbf49ea0f0df8bb7da (diff)
parent8c33b4cf67f47ee46fe0984751fd40c4cf7cf392 (diff)
Merge branch 'jn/maint-fix-pager' into maint
* jn/maint-fix-pager: tests: Fix race condition in t7006-pager t7006-pager: if stdout is not a terminal, make a new one tests: Add tests for automatic use of pager am: Fix launching of pager git svn: Fix launching of pager git.1: Clarify the behavior of the --paginate option Make 'git var GIT_PAGER' always print the configured pager Fix 'git var' usage synopsis
Diffstat (limited to 'git-sh-setup.sh')
-rwxr-xr-xgit-sh-setup.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 5e22440aec..7a095665d7 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -107,6 +107,19 @@ git_editor() {
eval "$GIT_EDITOR" '"$@"'
}
+git_pager() {
+ if test -t 1
+ then
+ GIT_PAGER=$(git var GIT_PAGER)
+ else
+ GIT_PAGER=cat
+ fi
+ : ${LESS=-FRSX}
+ export LESS
+
+ eval "$GIT_PAGER" '"$@"'
+}
+
sane_grep () {
GREP_OPTIONS= LC_ALL=C grep "$@"
}