Skip to content

Commit d5d0a23

Browse files
committed
Merge branch 'jc/pager-configuration-doc'
It was unclear in the documentation how various configurations and environment variables determine which pager is eventually used. * jc/pager-configuration-doc: config: rewrite core.pager documentation
2 parents 7b828a0 + 97d01f2 commit d5d0a23

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

Documentation/config.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -553,22 +553,20 @@ sequence.editor::
553553
When not configured the default commit message editor is used instead.
554554

555555
core.pager::
556-
The command that Git will use to paginate output. Can
557-
be overridden with the `GIT_PAGER` environment
558-
variable. Note that Git sets the `LESS` environment
559-
variable to `FRSX` if it is unset when it runs the
560-
pager. One can change these settings by setting the
561-
`LESS` variable to some other value. Alternately,
562-
these settings can be overridden on a project or
563-
global basis by setting the `core.pager` option.
564-
Setting `core.pager` has no effect on the `LESS`
565-
environment variable behaviour above, so if you want
566-
to override Git's default settings this way, you need
567-
to be explicit. For example, to disable the S option
568-
in a backward compatible manner, set `core.pager`
569-
to `less -+S`. This will be passed to the shell by
570-
Git, which will translate the final command to
571-
`LESS=FRSX less -+S`.
556+
Text viewer for use by Git commands (e.g., 'less'). The value
557+
is meant to be interpreted by the shell. The order of preference
558+
is the `$GIT_PAGER` environment variable, then `core.pager`
559+
configuration, then `$PAGER`, and then the default chosen at
560+
compile time (usually 'less').
561+
+
562+
When the `LESS` environment variable is unset, Git sets it to `FRSX`
563+
(if `LESS` environment variable is set, Git does not change it at
564+
all). If you want to selectively override Git's default setting
565+
for `LESS`, you can set `core.pager` to e.g. `less -+S`. This will
566+
be passed to the shell by Git, which will translate the final
567+
command to `LESS=FRSX less -+S`. The environment tells the command
568+
to set the `S` option to chop long lines but the command line
569+
resets it to the default to fold long lines.
572570

573571
core.whitespace::
574572
A comma separated list of common whitespace problems to

0 commit comments

Comments
 (0)