From: Christian Couder Date: Tue, 29 Jan 2008 06:08:44 +0000 (+0100) Subject: instaweb: use 'browser..path' config option if it's set. X-Git-Tag: v1.5.4~16 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ab989adf6ab32fb80fd42cc95ed0eacb029258fe;p=git.git instaweb: use 'browser..path' config option if it's set. Signed-off-by: Christian Couder Acked-by: Eric Wong Signed-off-by: Junio C Hamano --- diff --git a/Documentation/config.txt b/Documentation/config.txt index 477b2d913..4e222f15a 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -369,7 +369,8 @@ branch..rebase:: browser..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 ad0723ccc..3e4452bc4 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