@matheusbsbs / matheus-bagliano / commits / d3a866bc8b
Fork 0

Use {web,instaweb,help}.browser config options.

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>

Christian Couder committed Dec 2, 2007 at 06:08 UTC d3a866bc8b5604d31638648d671e524cc84fbb26
2 files changed +7 -2
git-browse-help.sh
+6 -2
@@ -70,9 +70,13 @@ do
70 done
71
72 if test -z "$browser"; then
73 - browser=`git config web.browser`
73 + for opt in "help.browser" "web.browser"
74 + do
75 + browser="`git config $opt`"
76 + test -z "$browser" || break
77 + done
78 if test -n "$browser" && ! valid_tool "$browser"; then
75 - echo >&2 "git config option web.browser set to unknown browser: $browser"
79 + echo >&2 "git config option $opt set to unknown browser: $browser"
80 echo >&2 "Resetting to default..."
81 unset browser
82 fi
git-instaweb.sh
+1
@@ -24,6 +24,7 @@ fqgitdir="$GIT_DIR"
24 local="`git config --bool --get instaweb.local`"
25 httpd="`git config --get instaweb.httpd`"
26 browser="`git config --get instaweb.browser`"
27 +test -z "$browser" && browser="`git config --get web.browser`"
28 port=`git config --get instaweb.port`
29 module_path="`git config --get instaweb.modulepath`"
30