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

Re: [PATCH] Documentation: replace 'vi' for 'editor' to reflect build-time option

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 30, 2012, 00:55 UTC
Message-ID
<20120330005523.GA28519@burratino>
In-Reply-To
<20120330002543.2138.91961.reportbug@localhost6.localdomain6>
Hi Rodrigo,
Rodrigo Silva (MestreLion) wrote:
Show 6 quoted lines
> git-var(1) did not say that hardcoded fallback 'vi' may have been changed
> at build time. A user could be puzzled if 'nano' pops up even when none of the
> mentioned environment vars or config.editor are set.
>
> Ideally, the build system should be changed to reflect the chosen fallback
> editor when creating the man pages. Not sure if that is even possible though.
Good catch.

Filling in the blank at compile time would be possible, but I'm not convinced it's a good idea. Wouldn't the same user be just as puzzled when

  http://git.kernel.org/?p=git/git-htmldocs.git;a=blob_plain;f=git-var.html

(or whatever page with a nicer URL arises to replace the old www.kernel.org/... pages) says the fallback is 'vi' and git behaves differently?

How about something like this?
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Context: http://bugs.debian.org/666250
 Documentation/git-var.txt |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git i/Documentation/git-var.txt w/Documentation/git-var.txt
index 5317cc24..beef9e28 100644
--- i/Documentation/git-var.txt
+++ w/Documentation/git-var.txt
@@ -43,13 +43,15 @@ 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'.
 
 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').
 
 Diagnostics
 -----------
Next: Junio C Hamano
Message 1 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.