Skip to content

Commit

Permalink
Use {web,instaweb,help}.browser config options.
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Dec 9, 2007
1 parent 5d6491c commit d3a866b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-browse-help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,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
Expand Down
1 change: 1 addition & 0 deletions git-instaweb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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`"

Expand Down

0 comments on commit d3a866b

Please sign in to comment.