git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/4] instaweb: use 'git-web--browse' to launch browser.

From
Christian Couder <chriscool@tuxfamily.org>
Date
Feb 2, 2008, 06:32 UTC
Message-ID
<20080202073256.d9ce1dba.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-instaweb.sh |   20 ++++++--------------
 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
-- 
1.5.4.rc5.25.g7a831-dirty
Message 1 of 1 in “instaweb: use 'git-web--browse' to launch browser.”
  1. 4/4 instaweb: use 'git-web--browse' to launch browser.Christian Couder, Feb 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.