summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Jonathan Nieder <jrnieder@gmail.com>2012-03-31 03:44:53 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-04-10 14:50:27 -0700
commit5b58619aa011c2047e7b67ca28630d8a2e72ca1f (patch)
tree7ccfa86a43f944b76a2347ac6416f90b0863341c /Documentation
parentvar doc: default editor and pager are configurable at build time (diff)
downloadtgif-5b58619aa011c2047e7b67ca28630d8a2e72ca1f.tar.xz
var doc: advertise current DEFAULT_PAGER and DEFAULT_EDITOR settings
Document the default pager and editor chosen at compile time in the git-var(1) manpage so users curious about what command _this_ copy of git will fall back to when EDITOR, VISUAL, and PAGER are unset can find the answer quickly. In builds leaving those settings uncustomized, this patch makes the manpage continue to say "usually vi" and "usually less" so the formatted documentation is usable for a wide audience including users of custom builds that change those settings. If you would like your copy of the docs to be less noncommittal, you will need to set DEFAULT_PAGER=less and DEFAULT_EDITOR=vi explicitly. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/Makefile10
-rw-r--r--Documentation/git-var.txt6
2 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
index d40e211f22..9fee0b9261 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -124,6 +124,16 @@ SHELL_PATH ?= $(SHELL)
# Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
+ifdef DEFAULT_PAGER
+DEFAULT_PAGER_SQ = $(subst ','\'',$(DEFAULT_PAGER))
+ASCIIDOC_EXTRA += -a 'git-default-pager=$(DEFAULT_PAGER_SQ)'
+endif
+
+ifdef DEFAULT_EDITOR
+DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR))
+ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'
+endif
+
#
# Please note that there is a minor bug in asciidoc.
# The version after 6.0.3 _will_ include the patch found here:
diff --git a/Documentation/git-var.txt b/Documentation/git-var.txt
index beef9e285d..988a3234f4 100644
--- a/Documentation/git-var.txt
+++ b/Documentation/git-var.txt
@@ -45,6 +45,9 @@ GIT_EDITOR::
environment variable, then `core.editor` configuration, then
`$VISUAL`, then `$EDITOR`, and then the default chosen at compile
time, which is usually 'vi'.
+ifdef::git-default-editor[]
+ The build you are using chose '{git-default-editor}' as the default.
+endif::git-default-editor[]
GIT_PAGER::
Text viewer for use by git commands (e.g., 'less'). The value
@@ -52,6 +55,9 @@ GIT_PAGER::
is the `$GIT_PAGER` environment variable, then `core.pager`
configuration, then `$PAGER`, and then the default chosen at
compile time (usually 'less').
+ifdef::git-default-pager[]
+ The build you are using chose '{git-default-pager}' as the default.
+endif::git-default-pager[]
Diagnostics
-----------