Skip to content

Commit

Permalink
Merge branch 'jn/debian-customizes-default-editor'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Apr 23, 2012
2 parents bca57ee + 5b58619 commit 2347982
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 10 additions & 2 deletions Documentation/git-var.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2347982

Please sign in to comment.