git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Junio Hamano <junkio@cox.net>
Cc: git@vger.kernel.org, Theodore Tso <tytso@mit.edu>,
	Jakub Narebski <jnareb@gmail.com>,
	Alex Riesen <raa.lkml@gmail.com>, Andreas Ericsson <ae@op5.se>,
	Matthieu Moy <Matthieu.Moy@imag.fr>,
	Eric Wong <normalperson@yhbt.net>
Subject: [PATCH 3/3] Use {web,instaweb,help}.browser config options.
Date: Sun, 2 Dec 2007 06:08:00 +0100	[thread overview]
Message-ID: <20071202060800.9eff150f.chriscool@tuxfamily.org> (raw)

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

                 reply	other threads:[~2007-12-02  5:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071202060800.9eff150f.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=Matthieu.Moy@imag.fr \
    --cc=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=junkio@cox.net \
    --cc=normalperson@yhbt.net \
    --cc=raa.lkml@gmail.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).