Skip to content

Commit

Permalink
Merge branch 'rf/man-env'
Browse files Browse the repository at this point in the history
* rf/man-env:
  builtin-help: fallback to GIT_MAN_VIEWER before man
  • Loading branch information
Junio C Hamano committed Sep 3, 2008
2 parents 1c12b38 + 5059a42 commit f3db366
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Documentation/git-help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~
Expand Down
3 changes: 3 additions & 0 deletions builtin-help.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit f3db366

Please sign in to comment.