Merge branch 'cc/browser'

* cc/browser:
  Documentation: add 'git-web--browse.txt' and simplify other docs.
  git-web--browse: fix misplaced quote in init_browser_path()
  web--browse: Add a few quotes in 'init_browser_path'.
  Documentation: instaweb: add 'git-web--browse' information.
  Adjust .gitignore for 5884f1(Rename 'git-help--browse.sh'...)
  git-web--browse: do not start the browser with nohup
  instaweb: use 'git-web--browse' to launch browser.
  Rename 'git-help--browse.sh' to 'git-web--browse.sh'.
  help--browse: add '--config' option to check a config option for a browser.
  help: make 'git-help--browse' usable outside 'git-help'.

Conflicts:

	git-web--browse.sh
This commit is contained in:
Junio C Hamano
2008-02-16 17:57:47 -08:00
8 changed files with 143 additions and 66 deletions

18
help.c
View File

@ -330,10 +330,26 @@ static void show_info_page(const char *git_cmd)
execlp("info", "info", "gitman", page, NULL);
}
static void get_html_page_path(struct strbuf *page_path, const char *page)
{
struct stat st;
/* Check that we have a git documentation directory. */
if (stat(GIT_HTML_PATH "/git.html", &st) || !S_ISREG(st.st_mode))
die("'%s': not a documentation directory.", GIT_HTML_PATH);
strbuf_init(page_path, 0);
strbuf_addf(page_path, GIT_HTML_PATH "/%s.html", page);
}
static void show_html_page(const char *git_cmd)
{
const char *page = cmd_to_page(git_cmd);
execl_git_cmd("help--browse", page, NULL);
struct strbuf page_path; /* it leaks but we exec bellow */
get_html_page_path(&page_path, page);
execl_git_cmd("web--browse", "-c", "help.browser", page_path.buf, NULL);
}
void help_unknown_cmd(const char *cmd)