Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 2347982

Browse files
committed
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
2 parents bca57ee + 5b58619 commit 2347982

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

Documentation/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ SHELL_PATH ?= $(SHELL)
124124
# Shell quote;
125125
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
126126

127+
ifdef DEFAULT_PAGER
128+
DEFAULT_PAGER_SQ = $(subst ','\'',$(DEFAULT_PAGER))
129+
ASCIIDOC_EXTRA += -a 'git-default-pager=$(DEFAULT_PAGER_SQ)'
130+
endif
131+
132+
ifdef DEFAULT_EDITOR
133+
DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR))
134+
ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'
135+
endif
136+
127137
#
128138
# Please note that there is a minor bug in asciidoc.
129139
# The version after 6.0.3 _will_ include the patch found here:

Documentation/git-var.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,21 @@ GIT_EDITOR::
4343
`$SOME_ENVIRONMENT_VARIABLE`, `"C:\Program Files\Vim\gvim.exe"
4444
--nofork`. The order of preference is the `$GIT_EDITOR`
4545
environment variable, then `core.editor` configuration, then
46-
`$VISUAL`, then `$EDITOR`, and then finally 'vi'.
46+
`$VISUAL`, then `$EDITOR`, and then the default chosen at compile
47+
time, which is usually 'vi'.
48+
ifdef::git-default-editor[]
49+
The build you are using chose '{git-default-editor}' as the default.
50+
endif::git-default-editor[]
4751

4852
GIT_PAGER::
4953
Text viewer for use by git commands (e.g., 'less'). The value
5054
is meant to be interpreted by the shell. The order of preference
5155
is the `$GIT_PAGER` environment variable, then `core.pager`
52-
configuration, then `$PAGER`, and then finally 'less'.
56+
configuration, then `$PAGER`, and then the default chosen at
57+
compile time (usually 'less').
58+
ifdef::git-default-pager[]
59+
The build you are using chose '{git-default-pager}' as the default.
60+
endif::git-default-pager[]
5361

5462
Diagnostics
5563
-----------

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,6 +2266,8 @@ $(XDIFF_LIB): $(XDIFF_OBJS)
22662266
$(VCSSVN_LIB): $(VCSSVN_OBJS)
22672267
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(VCSSVN_OBJS)
22682268

2269+
export DEFAULT_EDITOR DEFAULT_PAGER
2270+
22692271
doc:
22702272
$(MAKE) -C Documentation all
22712273

0 commit comments

Comments
 (0)