# [PATCH 3/3] instaweb: use 'browser.<tool>.path' config option if it's set.

2 messages from 2008-01-29 to 2008-01-29. Participants: Christian Couder, Eric Wong.
Thread: https://gitlist.dev/t/11781

## Christian Couder, 2008-01-29 06:08

Subject: [PATCH 3/3] instaweb: use 'browser.<tool>.path' config option if it's set.
Message-ID: <20080129070844.30781cd3.chriscool@tuxfamily.org>
URL: https://gitlist.dev/e/20080129070844.30781cd3.chriscool%40tuxfamily.org

```
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 Documentation/config.txt |    3 ++-
 git-instaweb.sh          |   10 +++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 477b2d9..4e222f1 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -369,7 +369,8 @@ branch.<name>.rebase::
 
 browser.<tool>.path::
 	Override the path for the given tool that may be used to
-	browse HTML help. See '-w' option in linkgit:git-help[1].
+	browse HTML help (see '-w' option in linkgit:git-help[1]) or a
+	working repository in gitweb (see linkgit:git-instaweb[1]).
 
 clean.requireForce::
 	A boolean to make git-clean do nothing unless given -f
diff --git a/git-instaweb.sh b/git-instaweb.sh
index ad0723c..3e4452b 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -274,6 +274,14 @@ webrick)
 	;;
 esac
 
+init_browser_path() {
+	browser_path="`git config browser.$1.path`"
+	test -z "$browser_path" && browser_path="$1"
+}
+
 start_httpd
 url=http://127.0.0.1:$port
-test -n "$browser" && "$browser" $url || echo $url
+test -n "$browser" && {
+	init_browser_path "$browser"
+	"$browser_path" $url
+} || echo $url
-- 
1.5.4.rc1.24.gf78d

```

## Eric Wong, 2008-01-29 08:46

Subject: Re: [PATCH 3/3] instaweb: use 'browser.<tool>.path' config option if it's set.
Message-ID: <20080129084618.GA15141@hand.yhbt.net>
URL: https://gitlist.dev/e/20080129084618.GA15141%40hand.yhbt.net
In-Reply-To: <20080129070844.30781cd3.chriscool@tuxfamily.org>

```
Christian Couder <chriscool@tuxfamily.org> wrote:
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>

Thanks Christian,

Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
>  Documentation/config.txt |    3 ++-
>  git-instaweb.sh          |   10 +++++++++-
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 477b2d9..4e222f1 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -369,7 +369,8 @@ branch.<name>.rebase::
>  
>  browser.<tool>.path::
>  	Override the path for the given tool that may be used to
> -	browse HTML help. See '-w' option in linkgit:git-help[1].
> +	browse HTML help (see '-w' option in linkgit:git-help[1]) or a
> +	working repository in gitweb (see linkgit:git-instaweb[1]).
>  
>  clean.requireForce::
>  	A boolean to make git-clean do nothing unless given -f
> diff --git a/git-instaweb.sh b/git-instaweb.sh
> index ad0723c..3e4452b 100755
> --- a/git-instaweb.sh
> +++ b/git-instaweb.sh
> @@ -274,6 +274,14 @@ webrick)
>  	;;
>  esac
>  
> +init_browser_path() {
> +	browser_path="`git config browser.$1.path`"
> +	test -z "$browser_path" && browser_path="$1"
> +}
> +
>  start_httpd
>  url=http://127.0.0.1:$port
> -test -n "$browser" && "$browser" $url || echo $url
> +test -n "$browser" && {
> +	init_browser_path "$browser"
> +	"$browser_path" $url
> +} || echo $url
> -- 
> 1.5.4.rc1.24.gf78d

```
