Thread (72 messages) flat view 72 messages, 20 authors, 2016-06-15

Re: [PATCH 05/12] Windows(msysgit): Per default, display help as HTML in default browser

From: Steffen Prohaska <hidden>
Date: 2016-06-15 22:44:53

Possibly related (same subject, not in this thread)

On Jul 2, 2008, at 8:57 PM, Johannes Sixt wrote:
On Mittwoch, 2. Juli 2008, Steffen Prohaska wrote:
quoted
The implementation directly calls the Win32 API to launch the  
browser.
Note that the specific directory layout of msysgit is required.
quoted
+#ifdef __MINGW32__
+	const char* exec_path = git_exec_path();
+	char *htmlpath = make_native_separator(
+			   mkpath("%s/../doc/git/html/%s.html"
+				  , exec_path
+				  , git_cmd)
+			 );
+	if (!file_exists(htmlpath)) {
+		htmlpath = make_native_separator(
+			      mkpath("%s/../doc/git/html/git-%s.html"
+				     , exec_path
+				     , git_cmd)
+			   );
+		if (!file_exists(htmlpath)) {
+			fprintf(stderr, "Can't find HTML help for '%s'.\n"
+				, git_cmd);
+			exit(1);
+		}
+	}
+	printf("Launching default browser to display HTML help ...\n");
+	ShellExecute(NULL, "open", htmlpath, NULL, "\\", 0);
+#else
Can't we move this part into git-web--browse.sh? It should be a  
matter of
calling

	start $htmlpath

(and msys-1.0.dll would convert slashes to backslashes for us).
I try to avoid the shell as much as possible on Windows.

How about the two following patches:

  [PATCH 1/2] help.c: Add support for htmldir relative to  
git_exec_path()
  [PATCH 2/2] help (Windows): Display HTML in default browser using  
Win32 API

I'll send them as replies to this mail.

	Steffen

	
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help