summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2008-02-02 06:32:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-05 09:01:49 (GMT)
commit2e0c290299e381884e4f4a4efb847fc8ecc4647c (patch)
tree85d42fedb0847f9b3be3b1bfc40d10c8bd949bd9
parent5884f1fe96b33d9666a78e660042b1e3e5f9f4d9 (diff)
downloadgit-2e0c290299e381884e4f4a4efb847fc8ecc4647c.zip
git-2e0c290299e381884e4f4a4efb847fc8ecc4647c.tar.gz
git-2e0c290299e381884e4f4a4efb847fc8ecc4647c.tar.bz2
instaweb: use 'git-web--browse' to launch browser.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-instaweb.sh20
1 files changed, 6 insertions, 14 deletions
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 3e4452b..6f91c8f 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -24,8 +24,6 @@ restart restart the web server
fqgitdir="$GIT_DIR"
local="`git config --bool --get instaweb.local`"
httpd="`git config --get instaweb.httpd`"
-browser="`git config --get instaweb.browser`"
-test -z "$browser" && browser="`git config --get web.browser`"
port=`git config --get instaweb.port`
module_path="`git config --get instaweb.modulepath`"
@@ -36,9 +34,6 @@ conf="$GIT_DIR/gitweb/httpd.conf"
# if installed, it doesn't need further configuration (module_path)
test -z "$httpd" && httpd='lighttpd -f'
-# probably the most popular browser among gitweb users
-test -z "$browser" && browser='firefox'
-
# any untaken local port will do...
test -z "$port" && port=1234
@@ -274,14 +269,11 @@ 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" && {
- init_browser_path "$browser"
- "$browser_path" $url
-} || echo $url
+
+if test -n "$browser"; then
+ git web--browse -b "$browser" $url || echo $url
+else
+ git web--browse -c "instaweb.browser" $url || echo $url
+fi