summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-04-23 12:41:15 -0700
committerJunio C Hamano <gitster@pobox.com>2012-04-23 12:41:15 -0700
commit2347982d1ad1a29fa93cd95eb51e5c74c689177e (patch)
tree3d8a043bc7366d72873cb59241bc2b7bc7d1b943
parentbca57eeac17204338aa142c16843522308b2d321 (diff)
parent5b58619aa011c2047e7b67ca28630d8a2e72ca1f (diff)
downloadgit-2347982d1ad1a29fa93cd95eb51e5c74c689177e.tar.gz
Merge branch 'jn/debian-customizes-default-editor'
Make it easier for distros to document custom pager and editor they used when building their binary releases in "git var" documentation. By Jonathan Nieder * jn/debian-customizes-default-editor: var doc: advertise current DEFAULT_PAGER and DEFAULT_EDITOR settings var doc: default editor and pager are configurable at build time
-rw-r--r--Documentation/Makefile10
-rw-r--r--Documentation/git-var.txt12
-rw-r--r--Makefile2
3 files changed, 22 insertions, 2 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 5317cc2474..988a3234f4 100644
--- a/Documentation/git-var.txt
+++ b/Documentation/git-var.txt
@@ -43,13 +43,21 @@ GIT_EDITOR::
`$SOME_ENVIRONMENT_VARIABLE`, `"C:\Program Files\Vim\gvim.exe"
--nofork`. The order of preference is the `$GIT_EDITOR`
environment variable, then `core.editor` configuration, then
- `$VISUAL`, then `$EDITOR`, and then finally 'vi'.
+ `$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
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 finally 'less'.
+ 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
-----------
diff --git a/Makefile b/Makefile
index 28a46e5594..172e924a29 100644
--- a/Makefile
+++ b/Makefile
@@ -2266,6 +2266,8 @@ $(XDIFF_LIB): $(XDIFF_OBJS)
$(VCSSVN_LIB): $(VCSSVN_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(VCSSVN_OBJS)
+export DEFAULT_EDITOR DEFAULT_PAGER
+
doc:
$(MAKE) -C Documentation all