summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-02 17:45:41 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-02 17:45:41 -0700
commitf3db366770ffc67196ee13cdcb65c6bfb45821f6 (patch)
tree13521d9696bdefafc7266e8d57d050c061151cc4
parent1c12b38601b5b4da61a2e90540a8de56261d93af (diff)
parent5059a427804f9fefaf75dd1aa92cb620ce9219c7 (diff)
downloadgit-f3db366770ffc67196ee13cdcb65c6bfb45821f6.tar.gz
Merge branch 'rf/man-env'
* rf/man-env: builtin-help: fallback to GIT_MAN_VIEWER before man
-rw-r--r--Documentation/git-help.txt4
-rw-r--r--builtin-help.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt
index f414583fc4..d9b9c34b3a 100644
--- a/Documentation/git-help.txt
+++ b/Documentation/git-help.txt
@@ -112,7 +112,9 @@ For example, this configuration:
will try to use konqueror first. But this may fail (for example if
DISPLAY is not set) and in that case emacs' woman mode will be tried.
-If everything fails the 'man' program will be tried anyway.
+If everything fails, or if no viewer is configured, the viewer specified
+in the GIT_MAN_VIEWER environment variable will be tried. If that
+fails too, the 'man' program will be tried anyway.
man.<tool>.path
~~~~~~~~~~~~~~~
diff --git a/builtin-help.c b/builtin-help.c
index 721038e4f5..64207cbfe9 100644
--- a/builtin-help.c
+++ b/builtin-help.c
@@ -361,12 +361,15 @@ static void show_man_page(const char *git_cmd)
{
struct man_viewer_list *viewer;
const char *page = cmd_to_page(git_cmd);
+ const char *fallback = getenv("GIT_MAN_VIEWER");
setup_man_path();
for (viewer = man_viewer_list; viewer; viewer = viewer->next)
{
exec_viewer(viewer->name, page); /* will return when unable */
}
+ if (fallback)
+ exec_viewer(fallback, page);
exec_viewer("man", page);
die("no man viewer handled the request");
}