Skip to content

Commit 97d01f2

Browse files
committed
config: rewrite core.pager documentation
The text mentions core.pager and GIT_PAGER without giving the overall picture of precedences. Borrow a better description from the git-var(1) documentation. The use of the mechanism to allow system-wide, global and per-repository configuration files is not limited to this particular variable. Remove it to clarify the paragraph. Rewrite the part that explains how the environment variable LESS is set to Git's default value, and how to selectively customize it. Signed-off-by: Junio C Hamano <[email protected]>
1 parent f59bebb commit 97d01f2

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
@@ -561,22 +561,20 @@ sequence.editor::
561561
When not configured the default commit message editor is used instead.
562562

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

581579
core.whitespace::
582580
A comma separated list of common whitespace problems to

0 commit comments

Comments
 (0)