help commands are ignoring my help.format and help.browser config values

480 views
Skip to first unread message

Dan

unread,
Feb 1, 2014, 3:50:55 PM2/1/14
to msy...@googlegroups.com
For my first time I have installed Git for Windows on Windows 8.1. It looks like Git help commands will open in the program .html files are associated with, not the browser I configured Git with. For example, `git diff --help` opens git-diff.html in Sublime Text.

My Git configuration: 
$ git config --list
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
browser.chrome.path=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
help.format=web
help.browser=chrome
web.browser=chrome

For what it's worth, `git web--browse google.com` will open google.com in Chrome.

Does it look like I have incorrect configuration?

Philip Oakley

unread,
Feb 2, 2014, 2:23:59 PM2/2/14
to Dan, msy...@googlegroups.com
From: Dan
Sent: Saturday, February 01, 2014 8:50 PM
Subject: [msysGit] help commands are ignoring my help.format and help.browser config values
--
`git help help`  says:
--web

Display manual page for the command in the web (HTML) format. A web browser will be used for that purpose.

The web browser can be specified using the configuration variable help.browser, or web.browser if the former is not set. If none of these config variables is set, the git web--browse helper script (called by git help) will pick a suitable default. See git-web--browse(1) for more information about this.

So yes, you have the wrong config variable...

Philip

Dan

unread,
Feb 2, 2014, 2:45:04 PM2/2/14
to msy...@googlegroups.com, Philip Oakley
Thanks Philip, Which config variable is incorrect? I've read your quote carefully. I am telling Git to open manual pages in the web with help.format=web and telling Git to use Chrome with help.browse=chrome. Git seems to be ignoring this.

On Sunday, February 2, 2014 1:23:59 PM UTC-6, Philip Oakley wrote:


Philip Oakley

unread,
Feb 2, 2014, 2:55:42 PM2/2/14
to Dan, msy...@googlegroups.com
Oops didn't read all the way to the end...
--web
--
--
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.
 
You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msy...@googlegroups.com
To unsubscribe from this group, send email to
msysgit+u...@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en
 
---
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Philip Oakley

unread,
Feb 2, 2014, 3:10:18 PM2/2/14
to Dan, msy...@googlegroups.com
Sorry for the Oops moment (earlier re-reply).
 
In the code C:\msysgitXX\git\builtin\help.c  L389 I see the note :
 
/*
 * If open_html is not defined in a platform-specific way (see for
 * example compat/mingw.h), we use the script web--browse to display
 * HTML.
 */
#ifndef open_html
static void open_html(const char *path)
{
 execl_git_cmd("web--browse", "-c", "help.browser", path, (char *)NULL);
}
#endif
 
which leads to  a C:\msysgitXX\git\compat\mingw.h L349
 
void mingw_open_html(const char *path);
#define open_html mingw_open_html
 
Onward to C:\msysgit179\git\compat\mingw.c L1746
 
void mingw_open_html(const char *unixpath)
{
 const char *htmlpath = make_backslash_path(unixpath);
 typedef HINSTANCE (WINAPI *T)(HWND, const char *,
   const char *, const char *, const char *, INT);
 T ShellExecute;
 HMODULE shell32;
 int r;
 
 shell32 = LoadLibrary("shell32.dll");
 if (!shell32)
  die("cannot load shell32.dll");
 ShellExecute = (T)GetProcAddress(shell32, "ShellExecuteA");
 if (!ShellExecute)
  die("cannot run browser");
 
 printf("Launching default browser to display HTML ...\n");
 r = (int)ShellExecute(NULL, "open", htmlpath, NULL, "\\", SW_SHOWNORMAL);
 FreeLibrary(shell32);
 /* see the MSDN documentation referring to the result codes here */
 if (r <= 32) {
  die("failed to launch browser for %.*s", MAX_PATH, unixpath);
 }
}
 
So it is the/your default Windows browser for HTML that is used.
 
Sorry for the confusion.
 
Philip
--

dwgr...@gmail.com

unread,
Feb 2, 2014, 3:49:33 PM2/2/14
to msy...@googlegroups.com, Philip Oakley
I think I see it. So, I'll have to associate .html files with a browser for `help` to work like I want it. Thanks!

On Sunday, February 2, 2014 2:10:18 PM UTC-6, Philip Oakley wrote:

Reply all
Reply to author
Forward
0 new messages