{"thread":{"id":"11767","subject":"[PATCH 2/2] instaweb: use 'browser.<tool>.path' config option if it's set.","startedAt":"2008-01-28T07:02:25Z","lastAt":"2008-01-28T07:38:52Z","messageCount":2,"participants":["Christian Couder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"66711","messageId":"20080128080225.583dbac8.chriscool@tuxfamily.org","threadId":"11767","inReplyTo":null,"subject":"[PATCH 2/2] instaweb: use 'browser.<tool>.path' config option if it's set.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-01-28T07:02:25Z","receivedAt":"2008-01-28T07:02:25Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/config.txt |    3 ++-\n git-instaweb.sh          |   10 +++++++++-\n 2 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex c2fedd1..584250c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -369,7 +369,8 @@ branch.<name>.rebase::\n \n browser.<tool>.path::\n \tOverride the path for the given tool that may be used to\n-\tbrowse help. See linkgit:git-help[1].\n+\tbrowse help (see linkgit:git-help[1]) or a working repository\n+\tin gitweb (see linkgit:git-instaweb[1]).\n \n clean.requireForce::\n \tA boolean to make git-clean do nothing unless given -f\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex ad0723c..b21a0a5 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -274,6 +274,14 @@ webrick)\n \t;;\n esac\n \n+init_browser_path() {\n+\tbrowser_path=`git config browser.$1.path`\n+\ttest -z \"$browser_path\" && browser_path=$1\n+}\n+\n start_httpd\n url=http://127.0.0.1:$port\n-test -n \"$browser\" && \"$browser\" $url || echo $url\n+test -n \"$browser\" && {\n+\tinit_browser_path \"$browser\"\n+\t\"$browser_path\" $url\n+} || echo $url\n-- \n1.5.4.rc4.16.g1009\n"},{"id":"66716","messageId":"7vtzkyv1pv.fsf@gitster.siamese.dyndns.org","threadId":"11767","inReplyTo":"20080128080225.583dbac8.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] instaweb: use 'browser.<tool>.path' config option if it's set.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-28T07:38:52Z","receivedAt":"2008-01-28T07:38:52Z","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> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  Documentation/config.txt |    3 ++-\n>  git-instaweb.sh          |   10 +++++++++-\n>  2 files changed, 11 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index c2fedd1..584250c 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -369,7 +369,8 @@ branch.<name>.rebase::\n>  \n>  browser.<tool>.path::\n>  \tOverride the path for the given tool that may be used to\n> -\tbrowse help. See linkgit:git-help[1].\n> +\tbrowse help (see linkgit:git-help[1]) or a working repository\n> +\tin gitweb (see linkgit:git-instaweb[1]).\n>  \n>  clean.requireForce::\n>  \tA boolean to make git-clean do nothing unless given -f\n> diff --git a/git-instaweb.sh b/git-instaweb.sh\n> index ad0723c..b21a0a5 100755\n> --- a/git-instaweb.sh\n> +++ b/git-instaweb.sh\n> @@ -274,6 +274,14 @@ webrick)\n>  \t;;\n>  esac\n>  \n> +init_browser_path() {\n> +\tbrowser_path=`git config browser.$1.path`\n\nNeedquote?\n\n> +\ttest -z \"$browser_path\" && browser_path=$1\n> +}\n> +\n>  start_httpd\n>  url=http://127.0.0.1:$port\n> -test -n \"$browser\" && \"$browser\" $url || echo $url\n> +test -n \"$browser\" && {\n> +\tinit_browser_path \"$browser\"\n> +\t\"$browser_path\" $url\n> +} || echo $url\n> -- \n> 1.5.4.rc4.16.g1009\n"}]}