git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] var doc: advertise current DEFAULT_PAGER and DEFAULT_EDITOR settings

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2012, 17:55 UTC
Message-ID
<7v1uo8k64l.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120331084453.GE4119@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 16 quoted lines
> 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>
> ---
> Thanks for reading.
Thanks for a patch.

I think the Makefile patch to use "-a" takes the right approach (assuming that the name of the EDITOR/PAGER won't have funny character that would trip up AsciiDoc, which I think is a reasonably assumption), but I think even the customized package should say what it is "usually" set on other people's systems.

In other words, instead of:
Show 7 quoted lines
>      `$VISUAL`, then `$EDITOR`, and then the default chosen at compile
> +ifndef::git-default-editor[]
>      time, which is usually 'vi'.
> +endif::git-default-editor[]
> +ifdef::git-default-editor[]
> +    time ('{git-default-editor}').
> +endif::git-default-editor[]
something like:
	... 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[]
may be less confusing.
Previous: Jonathan NiederNext: Jonathan Nieder
Message 7 of 11 in “Re: [PATCH] Documentation: replace 'vi' for 'editor' to reflect build-time option”
  1. Jonathan NiederMar 30, 2012
  2. Junio C HamanoMar 30, 2012
  3. Bug#666250: [PATCH] Documentation: replace 'vi' for 'editor' to reflect build-time optionRodrigo Silva, Mar 30, 2012
  4. 0/2 Re: Documentation: replace 'vi' for 'editor' to reflect build-time optionJonathan Nieder, Mar 31, 2012
  5. 1/2 var doc: default editor and pager are configurable at build timeJonathan Nieder, Mar 31, 2012
  6. 2/2 var doc: advertise current DEFAULT_PAGER and DEFAULT_EDITOR settingsJonathan Nieder, Mar 31, 2012
  7. Junio C HamanoMar 31, 2012
  8. Jonathan NiederApr 18, 2012
  9. Phil HordMar 31, 2012
  10. Junio C HamanoMar 30, 2012
  11. Jonathan NiederMar 31, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.