{"thread":{"id":"11086","subject":"[PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","startedAt":"2007-12-02T05:07:55Z","lastAt":"2007-12-08T08:28:44Z","messageCount":8,"participants":["Christian Couder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"61618","messageId":"20071202060755.4d6d5ec8.chriscool@tuxfamily.org","threadId":"11086","inReplyTo":null,"subject":"[PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-12-02T05:07:55Z","receivedAt":"2007-12-02T05:07:55Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Now when using \"git help -w XXX\", we will try to show the HTML man\npage \"git-XXX.html\" in your prefered web browser.\n\nTo do that \"help.c\" code will call a new shell script\n\"git-browse-help\".\n\nThis currently works only if the HTML versions of the man page\nhave been installed in \"PREFIX/share/doc/git-doc\", so new target\nto do that is added to \"Documentation/Makefile\".\n\nThe browser to use can be configured using the \"web.browser\"\nconfig variable.\n\nWe try to open a new tab in an existing web browser, if possible.\n\nThe code in \"git-browse-help\" is heavily stolen from \"git-mergetool\"\nby Theodore Y. Ts'o. Thanks.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/Makefile |    4 +\n Makefile               |    4 +-\n git-browse-help.sh     |  154 ++++++++++++++++++++++++++++++++++++++++++++++++\n help.c                 |   15 ++++-\n 4 files changed, 175 insertions(+), 2 deletions(-)\n create mode 100755 git-browse-help.sh\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex d886641..3e01718 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -29,6 +29,7 @@ DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))\n \n prefix?=$(HOME)\n bindir?=$(prefix)/bin\n+htmldir?=$(prefix)/share/doc/git-doc\n mandir?=$(prefix)/share/man\n man1dir=$(mandir)/man1\n man5dir=$(mandir)/man5\n@@ -95,6 +96,9 @@ install-info: info\n \t  echo \"No directory found in $(DESTDIR)$(infodir)\" >&2 ; \\\n \tfi\n \n+install-html: html\n+\tsh ./install-webdoc.sh $(htmldir)\n+\n ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE\n \t$(MAKE) -C ../ GIT-VERSION-FILE\n \ndiff --git a/Makefile b/Makefile\nindex a5a40ce..9204bfe 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -223,7 +223,8 @@ SCRIPT_SH = \\\n \tgit-merge-resolve.sh \\\n \tgit-lost-found.sh git-quiltimport.sh git-submodule.sh \\\n \tgit-filter-branch.sh \\\n-\tgit-stash.sh\n+\tgit-stash.sh \\\n+\tgit-browse-help.sh\n \n SCRIPT_PERL = \\\n \tgit-add--interactive.perl \\\n@@ -807,6 +808,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n \t    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n+\t    -e 's|@@PREFIX@@|$(prefix_SQ)|g' \\\n \t    $@.sh >$@+ && \\\n \tchmod +x $@+ && \\\n \tmv $@+ $@\ndiff --git a/git-browse-help.sh b/git-browse-help.sh\nnew file mode 100755\nindex 0000000..11f8bfa\n--- /dev/null\n+++ b/git-browse-help.sh\n@@ -0,0 +1,154 @@\n+#!/bin/sh\n+#\n+# This program launch a web browser on the html page\n+# describing a git command.\n+#\n+# Copyright (c) 2007 Christian Couder\n+# Copyright (c) 2006 Theodore Y. Ts'o\n+#\n+# This file is heavily stolen from git-mergetool.sh, by\n+# Theodore Y. Ts'o (thanks) that is:\n+#\n+# Copyright (c) 2006 Theodore Y. Ts'o\n+#\n+# This file is licensed under the GPL v2, or a later version\n+# at the discretion of Junio C Hamano or any other official\n+# git maintainer.\n+#\n+\n+USAGE='[--browser=browser|--tool=browser] [cmd to display] ...'\n+SUBDIRECTORY_OK=Yes\n+OPTIONS_SPEC=\n+. git-sh-setup\n+\n+PREFIX=\"@@PREFIX@@\"\n+GIT_VERSION=\"@@GIT_VERSION@@\"\n+\n+# Directories that may contain html documentation:\n+install_html_dir=\"$PREFIX/share/doc/git-doc\"\n+rpm_dir=\"$PREFIX/share/doc/git-core-$GIT_VERSION\"\n+\n+# Look for the directory that really contains html documentation.\n+html_dir=''\n+for dir in \"$install_html_dir\" \"$rpm_dir\"\n+do\n+\ttest -d \"$dir\" && { html_dir=\"$dir\" ; break ; }\n+done\n+test -n \"$html_dir\" || die \"No documentation directory found.\"\n+\n+valid_tool() {\n+\tcase \"$1\" in\n+\t\tfirefox | iceweasel | konqueror | w3m | links | lynx | dillo)\n+\t\t\t;; # happy\n+\t\t*)\n+\t\t\treturn 1\n+\t\t\t;;\n+\tesac\n+}\n+\n+init_browser_path() {\n+\tbrowser_path=`git config browser.$1.path`\n+\ttest -z \"$browser_path\" && browser_path=$1\n+}\n+\n+while test $# != 0\n+do\n+    case \"$1\" in\n+\t-b|--browser*|-t|--tool*)\n+\t    case \"$#,$1\" in\n+\t\t*,*=*)\n+\t\t    browser=`expr \"z$1\" : 'z-[^=]*=\\(.*\\)'`\n+\t\t    ;;\n+\t\t1,*)\n+\t\t    usage ;;\n+\t\t*)\n+\t\t    browser=\"$2\"\n+\t\t    shift ;;\n+\t    esac\n+\t    ;;\n+\t--)\n+\t    break\n+\t    ;;\n+\t-*)\n+\t    usage\n+\t    ;;\n+\t*)\n+\t    break\n+\t    ;;\n+    esac\n+    shift\n+done\n+\n+if test -z \"$browser\"; then\n+    browser=`git config web.browser`\n+    if test -n \"$browser\" && ! valid_tool \"$browser\"; then\n+\t    echo >&2 \"git config option web.browser set to unknown browser: $browser\"\n+\t    echo >&2 \"Resetting to default...\"\n+\t    unset browser\n+    fi\n+fi\n+\n+if test -z \"$browser\" ; then\n+    if test -n \"$DISPLAY\"; then\n+        browser_candidates=\"firefox iceweasel konqueror w3m links lynx dillo\"\n+        if test \"$KDE_FULL_SESSION\" = \"true\"; then\n+            browser_candidates=\"konqueror $browser_candidates\"\n+        fi\n+    else\n+        browser_candidates=\"w3m links lynx\"\n+    fi\n+    echo \"browser candidates: $browser_candidates\"\n+    for i in $browser_candidates; do\n+        init_browser_path $i\n+        if type \"$browser_path\" > /dev/null 2>&1; then\n+            browser=$i\n+            break\n+        fi\n+    done\n+    test -z \"$browser\" && die \"No known browser available.\"\n+else\n+    valid_tool \"$browser\" || die \"Unknown browser '$browser'.\"\n+\n+    init_browser_path \"$browser\"\n+\n+    if ! type \"$browser_path\" > /dev/null 2>&1; then\n+        die \"The browser $browser is not available as '$browser_path'.\"\n+    fi\n+fi\n+\n+pages=$(for p in \"$@\"; do echo \"$html_dir/$p.html\" ; done)\n+test -z \"$pages\" && pages=\"$html_dir/git.html\"\n+\n+case \"$browser\" in\n+    firefox|iceweasel)\n+        # Check version because firefox < 2.0 does not support \"-new-tab\".\n+\tvers=$(expr \"$($browser_path -version)\" : '.* \\([0-9][0-9]*\\)\\..*')\n+\tNEWTAB='-new-tab'\n+\ttest \"$vers\" -lt 2 && NEWTAB=''\n+        nohup \"$browser_path\" $NEWTAB $pages &\n+\t;;\n+    konqueror)\n+\tcase \"$(basename \"$browser_path\")\" in\n+\t    konqueror)\n+\t\t# It's simpler to use kfmclient to open a new tab in konqueror.\n+\t\tbrowser_path=\"$(echo \"$browser_path\" | sed -e 's/konqueror$/kfmclient/')\"\n+\t\ttype \"$browser_path\" > /dev/null 2>&1 || die \"No '$browser_path' found.\"\n+\t\teval \"$browser_path\" newTab $pages\n+\t\t;;\n+\t    kfmclient)\n+\t\teval \"$browser_path\" newTab $pages\n+\t\t;;\n+\t    *)\n+\t        nohup \"$browser_path\" $pages &\n+\t\t;;\n+\tesac\n+        ;;\n+    w3m|links|lynx)\n+        eval \"$browser_path\" $pages\n+        ;;\n+    dillo)\n+        nohup \"$browser_path\" $pages &\n+        ;;\n+esac\n+\n+\ndiff --git a/help.c b/help.c\nindex 0f1cb71..ecc8c66 100644\n--- a/help.c\n+++ b/help.c\n@@ -265,6 +265,12 @@ static void show_info_page(const char *git_cmd)\n \texeclp(\"info\", \"info\", page, NULL);\n }\n \n+static void show_html_page(const char *git_cmd)\n+{\n+\tconst char *page = cmd_to_page(git_cmd);\n+\texeclp(\"git-browse-help\", \"git-browse-help\", page, NULL);\n+}\n+\n void help_unknown_cmd(const char *cmd)\n {\n \tfprintf(stderr, \"git: '%s' is not a git-command. See 'git --help'.\\n\", cmd);\n@@ -297,7 +303,14 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n \tconst char *help_cmd = argc > 1 ? argv[1] : NULL;\n \tcheck_help_cmd(help_cmd);\n \n-\tif (!strcmp(help_cmd, \"--info\") || !strcmp(help_cmd, \"-i\")) {\n+\tif (!strcmp(help_cmd, \"--web\") || !strcmp(help_cmd, \"-w\")) {\n+\t\thelp_cmd = argc > 2 ? argv[2] : NULL;\n+\t\tcheck_help_cmd(help_cmd);\n+\n+\t\tshow_html_page(help_cmd);\n+\t}\n+\n+\telse if (!strcmp(help_cmd, \"--info\") || !strcmp(help_cmd, \"-i\")) {\n \t\thelp_cmd = argc > 2 ? argv[2] : NULL;\n \t\tcheck_help_cmd(help_cmd);\n \n-- \n1.5.3.6.1993.g154f-dirty\n"},{"id":"62164","messageId":"7v3aufeowe.fsf@gitster.siamese.dyndns.org","threadId":"11086","inReplyTo":"20071202060755.4d6d5ec8.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-06T17:03:45Z","receivedAt":"2007-12-06T17:03:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> diff --git a/Documentation/Makefile b/Documentation/Makefile\n> index d886641..3e01718 100644\n> --- a/Documentation/Makefile\n> +++ b/Documentation/Makefile\n> @@ -29,6 +29,7 @@ DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))\n>  \n>  prefix?=$(HOME)\n>  bindir?=$(prefix)/bin\n> +htmldir?=$(prefix)/share/doc/git-doc\n>  mandir?=$(prefix)/share/man\n>  man1dir=$(mandir)/man1\n>  man5dir=$(mandir)/man5\n\nDoing this and then ...\n\n> diff --git a/Makefile b/Makefile\n> index a5a40ce..9204bfe 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -807,6 +808,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n>  \t    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \\\n>  \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n>  \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n> +\t    -e 's|@@PREFIX@@|$(prefix_SQ)|g' \\\n>  \t    $@.sh >$@+ && \\\n>  \tchmod +x $@+ && \\\n>  \tmv $@+ $@\n> ...\n> diff --git a/git-browse-help.sh b/git-browse-help.sh\n> new file mode 100755\n> index 0000000..11f8bfa\n> --- /dev/null\n> +++ b/git-browse-help.sh\n> @@ -0,0 +1,154 @@\n> +#!/bin/sh\n> ...\n> +USAGE='[--browser=browser|--tool=browser] [cmd to display] ...'\n> +SUBDIRECTORY_OK=Yes\n> +OPTIONS_SPEC=\n> +. git-sh-setup\n> +\n> +PREFIX=\"@@PREFIX@@\"\n> +GIT_VERSION=\"@@GIT_VERSION@@\"\n> +\n> +# Directories that may contain html documentation:\n> +install_html_dir=\"$PREFIX/share/doc/git-doc\"\n> +rpm_dir=\"$PREFIX/share/doc/git-core-$GIT_VERSION\"\n\n... doing this is wrong. People can set htmldir to somewhere other than\n$(prefix)/share/doc/git-doc while building and installing, but you are\nnot telling the munged script where it is.\n\n> +init_browser_path() {\n> +\tbrowser_path=`git config browser.$1.path`\n> +\ttest -z \"$browser_path\" && browser_path=$1\n> +}\n\nPlease do not contaminate the config file with something the user can\neasily use a lot more standardized way (iow $PATH) to configure to his\ntaste.\n\nI'd suggest dropping this bit.\n"},{"id":"62165","messageId":"7vve7bda8y.fsf@gitster.siamese.dyndns.org","threadId":"11086","inReplyTo":"20071202060755.4d6d5ec8.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-06T17:05:33Z","receivedAt":"2007-12-06T17:05:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> diff --git a/help.c b/help.c\n> index 0f1cb71..ecc8c66 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -297,7 +303,14 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n>  \tconst char *help_cmd = argc > 1 ? argv[1] : NULL;\n>  \tcheck_help_cmd(help_cmd);\n>  \n> -\tif (!strcmp(help_cmd, \"--info\") || !strcmp(help_cmd, \"-i\")) {\n> +\tif (!strcmp(help_cmd, \"--web\") || !strcmp(help_cmd, \"-w\")) {\n> +\t\thelp_cmd = argc > 2 ? argv[2] : NULL;\n> +\t\tcheck_help_cmd(help_cmd);\n> +\n> +\t\tshow_html_page(help_cmd);\n> +\t}\n> +\n> +\telse if (!strcmp(help_cmd, \"--info\") || !strcmp(help_cmd, \"-i\")) {\n>  \t\thelp_cmd = argc > 2 ? argv[2] : NULL;\n>  \t\tcheck_help_cmd(help_cmd);\n\nIsn't this \"check-help-cmd\" duplication ugly, by the way?\n"},{"id":"62241","messageId":"200712070635.18018.chriscool@tuxfamily.org","threadId":"11086","inReplyTo":"7v3aufeowe.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-12-07T05:35:17Z","receivedAt":"2007-12-07T05:35:17Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le jeudi 6 décembre 2007, Junio C Hamano a écrit :\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> > diff --git a/Documentation/Makefile b/Documentation/Makefile\n> > index d886641..3e01718 100644\n> > --- a/Documentation/Makefile\n> > +++ b/Documentation/Makefile\n> > @@ -29,6 +29,7 @@ DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))\n> >\n> >  prefix?=$(HOME)\n> >  bindir?=$(prefix)/bin\n> > +htmldir?=$(prefix)/share/doc/git-doc\n> >  mandir?=$(prefix)/share/man\n> >  man1dir=$(mandir)/man1\n> >  man5dir=$(mandir)/man5\n>\n> Doing this and then ...\n>\n> > diff --git a/Makefile b/Makefile\n> > index a5a40ce..9204bfe 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -807,6 +808,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n> >  \t    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \\\n> >  \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n> >  \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n> > +\t    -e 's|@@PREFIX@@|$(prefix_SQ)|g' \\\n> >  \t    $@.sh >$@+ && \\\n> >  \tchmod +x $@+ && \\\n> >  \tmv $@+ $@\n> > ...\n> > diff --git a/git-browse-help.sh b/git-browse-help.sh\n> > new file mode 100755\n> > index 0000000..11f8bfa\n> > --- /dev/null\n> > +++ b/git-browse-help.sh\n> > @@ -0,0 +1,154 @@\n> > +#!/bin/sh\n> > ...\n> > +USAGE='[--browser=browser|--tool=browser] [cmd to display] ...'\n> > +SUBDIRECTORY_OK=Yes\n> > +OPTIONS_SPEC=\n> > +. git-sh-setup\n> > +\n> > +PREFIX=\"@@PREFIX@@\"\n> > +GIT_VERSION=\"@@GIT_VERSION@@\"\n> > +\n> > +# Directories that may contain html documentation:\n> > +install_html_dir=\"$PREFIX/share/doc/git-doc\"\n> > +rpm_dir=\"$PREFIX/share/doc/git-core-$GIT_VERSION\"\n>\n> ... doing this is wrong. People can set htmldir to somewhere other than\n> $(prefix)/share/doc/git-doc while building and installing, but you are\n> not telling the munged script where it is.\n\nYeah, I sent a fix for this.\n\n> > +init_browser_path() {\n> > +\tbrowser_path=`git config browser.$1.path`\n> > +\ttest -z \"$browser_path\" && browser_path=$1\n> > +}\n>\n> Please do not contaminate the config file with something the user can\n> easily use a lot more standardized way (iow $PATH) to configure to his\n> taste.\n>\n> I'd suggest dropping this bit.\n\nI stole this part from \"git-mergetool.sh\":\n\ninit_merge_tool_path() {\n        merge_tool_path=`git config mergetool.$1.path`\n        if test -z \"$merge_tool_path\" ; then\n                case \"$1\" in\n                        emerge)\n                                merge_tool_path=emacs\n                                ;;\n                        *)\n                                merge_tool_path=$1\n                                ;;\n                esac\n        fi\n}\n\nSo we should either drop it in \"git-mergetool.sh\" too or keep it in both \nscripts.\n\nThanks,\nChristian.\n"},{"id":"62244","messageId":"7v1w9z9h2k.fsf@gitster.siamese.dyndns.org","threadId":"11086","inReplyTo":"200712070635.18018.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-07T06:04:03Z","receivedAt":"2007-12-07T06:04:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n>> > +# Directories that may contain html documentation:\n>> > +install_html_dir=\"$PREFIX/share/doc/git-doc\"\n>> > +rpm_dir=\"$PREFIX/share/doc/git-core-$GIT_VERSION\"\n>>\n>> ... doing this is wrong. People can set htmldir to somewhere other than\n>> $(prefix)/share/doc/git-doc while building and installing, but you are\n>> not telling the munged script where it is.\n>\n> Yeah, I sent a fix for this.\n\nWhy do you even need to fallback?  I'd rather drop these two fallbacks\nentirely.\n\nDistros have their own html documentation layout policy, so I suspect\nthey will patch this part to their liking anyway, and this point will\nmostly become moot.  For source distribution, I'd prefer to point at\nthe place we know we are installing in.\n\n>> > +init_browser_path() {\n>> > +\tbrowser_path=`git config browser.$1.path`\n>> > +\ttest -z \"$browser_path\" && browser_path=$1\n>> > +}\n>>\n>> Please do not contaminate the config file with something the user can\n>> easily use a lot more standardized way (iow $PATH) to configure to his\n>> taste.\n>>\n>> I'd suggest dropping this bit.\n>\n> I stole this part from \"git-mergetool.sh\":\n>\n> init_merge_tool_path() {\n>         merge_tool_path=`git config mergetool.$1.path`\n>         if test -z \"$merge_tool_path\" ; then\n>                 case \"$1\" in\n>                         emerge)\n>                                 merge_tool_path=emacs\n>                                 ;;\n> ...\n> }\n>\n> So we should either drop it in \"git-mergetool.sh\" too or keep it in both \n> scripts.\n\nI think this is an irrelevant defense.  If others are doing bad, that is\nnot a justification to make things worse.\n\nIn the case of mergetool, it has case \"$merge_tool\" that can be spelled\ntotally differently from path (e.g. emerge and emacs), so that function\nitself is semi justified.  For browser I do not think there isn't such\njustification.\n"},{"id":"62249","messageId":"7vfxyf7zoi.fsf@gitster.siamese.dyndns.org","threadId":"11086","inReplyTo":"7v1w9z9h2k.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-07T07:05:01Z","receivedAt":"2007-12-07T07:05:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> ...\n>>> > +init_browser_path() {\n>>> > +\tbrowser_path=`git config browser.$1.path`\n>>> > +\ttest -z \"$browser_path\" && browser_path=$1\n>>> > +}\n>>>\n>>> Please do not contaminate the config file with something the user can\n>>> easily use a lot more standardized way (iow $PATH) to configure to his\n>>> taste.\n>>>\n>>> I'd suggest dropping this bit.\n\nWell, I changed my mind.  It is a bit funny to have both firefox and\niceweasel as \"valid-tool\", but if we consider $browser to define the\nexternal interface and $browser_path to define the implementation, it\nsort of makes sense to have that configuration.  browser_path could be\niceweasel for browser firefox.\n\nI'll squash the patch to update the one from the last round (as the last\ntwo patches are not yet accepted in 'next' yet), remove the html\ndocumentation path fallback, but will leave this part in.\n\nbrowser.*.path and web.browser configuration need to be documented, if\nnot already, though.\n"},{"id":"62367","messageId":"200712080500.06857.chriscool@tuxfamily.org","threadId":"11086","inReplyTo":"7vfxyf7zoi.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-12-08T04:00:06Z","receivedAt":"2007-12-08T04:00:06Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le vendredi 7 décembre 2007, Junio C Hamano a écrit :\n> Junio C Hamano <gitster@pobox.com> writes:\n> > Christian Couder <chriscool@tuxfamily.org> writes:\n> > ...\n> >\n> >>> > +init_browser_path() {\n> >>> > +\tbrowser_path=`git config browser.$1.path`\n> >>> > +\ttest -z \"$browser_path\" && browser_path=$1\n> >>> > +}\n> >>>\n> >>> Please do not contaminate the config file with something the user can\n> >>> easily use a lot more standardized way (iow $PATH) to configure to\n> >>> his taste.\n> >>>\n> >>> I'd suggest dropping this bit.\n>\n> Well, I changed my mind.  It is a bit funny to have both firefox and\n> iceweasel as \"valid-tool\", but if we consider $browser to define the\n> external interface and $browser_path to define the implementation, it\n> sort of makes sense to have that configuration.  browser_path could be\n> iceweasel for browser firefox.\n>\n> I'll squash the patch to update the one from the last round (as the last\n> two patches are not yet accepted in 'next' yet), remove the html\n> documentation path fallback, but will leave this part in.\n\nThanks.\n\n> browser.*.path and web.browser configuration need to be documented, if\n> not already, though.\n\nDid you see this patch:\n\nhttp://article.gmane.org/gmane.comp.version-control.git/67101\n\nChristian.\n"},{"id":"62389","messageId":"7vir39wpxf.fsf@gitster.siamese.dyndns.org","threadId":"11086","inReplyTo":"20071202060755.4d6d5ec8.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-08T08:28:44Z","receivedAt":"2007-12-08T08:28:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> diff --git a/help.c b/help.c\n> index 0f1cb71..ecc8c66 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -265,6 +265,12 @@ static void show_info_page(const char *git_cmd)\n>  \texeclp(\"info\", \"info\", page, NULL);\n>  }\n>  \n> +static void show_html_page(const char *git_cmd)\n> +{\n> +\tconst char *page = cmd_to_page(git_cmd);\n> +\texeclp(\"git-browse-help\", \"git-browse-help\", page, NULL);\n> +}\n> +\n\nThis should be execl_git_cmd() to honor GIT_TRACE and to help transition\nto bindir != gitexecdir layout, I think.\n"}]}