Skip to content

Commit

Permalink
config: rewrite core.pager documentation
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Aug 29, 2013
1 parent f59bebb commit 97d01f2
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -561,22 +561,20 @@ sequence.editor::
When not configured the default commit message editor is used instead.

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

core.whitespace::
A comma separated list of common whitespace problems to
Expand Down

0 comments on commit 97d01f2

Please sign in to comment.