summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-16 17:57:47 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-16 17:57:47 -0800
commit990732609ce735c482e571ad95767edf1d693b41 (patch)
tree517384395ef2991463a5da92c36c386a132c5aa0 /help.c
parent987e315a6b5a5dd224602f09b9dc7c0fe9c7d024 (diff)
parentcb45f83cbdfcde4333ea5982b3c763e136fc599c (diff)
downloadgit-990732609ce735c482e571ad95767edf1d693b41.tar.gz
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
Diffstat (limited to 'help.c')
-rw-r--r--help.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/help.c b/help.c
index 95e7640fed..6e28ad9e71 100644
--- a/help.c
+++ b/help.c
@@ -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)