summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 445cac1)
raw | patch | inline | side by side (parent: 445cac1)
author | Romain Francoise <romain@orebokech.com> | |
Fri, 29 Aug 2008 15:00:43 +0000 (17:00 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 30 Aug 2008 04:46:33 +0000 (21:46 -0700) |
In some situations it is useful to be able to switch viewers via the
environment, e.g. in Emacs shell buffers. So check the GIT_MAN_VIEWER
environment variable and try it before falling back to "man".
Signed-off-by: Romain Francoise <romain@orebokech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
environment, e.g. in Emacs shell buffers. So check the GIT_MAN_VIEWER
environment variable and try it before falling back to "man".
Signed-off-by: Romain Francoise <romain@orebokech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-help.txt | patch | blob | history | |
builtin-help.c | patch | blob | history |
index f414583fc48e85e4785fbf5f9431bb81a96ccd9d..d9b9c34b3a60f09bea4f9e53b5127f33f356e042 100644 (file)
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 721038e4f55703d00efc62af8ccf4588182fb58f..64207cbfe909d17ea9698d3ff680203eee9f5c01 100644 (file)
--- a/builtin-help.c
+++ b/builtin-help.c
{
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");
}