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

[PATCH 3/3] Use {web,instaweb,help}.browser config options.

From
Christian Couder <chriscool@tuxfamily.org>
Date
Dec 2, 2007, 05:08 UTC
Message-ID
<20071202060800.9eff150f.chriscool@tuxfamily.org>

Now "git-instaweb" will try to use the browser configured as "web.browser", if "instaweb.browser" is not set.

"git-browse-help" will check first "help.browser" and then "web.browser".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-browse-help.sh |    8 ++++++--
 git-instaweb.sh    |    1 +
 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/git-browse-help.sh b/git-browse-help.sh
index 11f8bfa..de52365 100755
--- a/git-browse-help.sh
+++ b/git-browse-help.sh
@@ -80,9 +80,13 @@ do
 done
 
 if test -z "$browser"; then
-    browser=`git config web.browser`
+    for opt in "help.browser" "web.browser"
+    do
+	browser="`git config $opt`"
+	test -z "$browser" || break
+    done
     if test -n "$browser" && ! valid_tool "$browser"; then
-	    echo >&2 "git config option web.browser set to unknown browser: $browser"
+	    echo >&2 "git config option $opt set to unknown browser: $browser"
 	    echo >&2 "Resetting to default..."
 	    unset browser
     fi
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 8503ae4..42d8d7f 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -24,6 +24,7 @@ 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`"
 
-- 
1.5.3.6.1993.g154f-dirty
Message 1 of 1 in “Use {web,instaweb,help}.browser config options.”
  1. 3/3 Use {web,instaweb,help}.browser config options.Christian Couder, Dec 2, 2007

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.