instaweb: use 'browser.<tool>.path' config option if it's set.
authorChristian Couder <chriscool@tuxfamily.org>
Tue, 29 Jan 2008 06:08:44 +0000 (07:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jan 2008 08:49:28 +0000 (00:49 -0800)
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
git-instaweb.sh
index 477b2d913897ab65debcf48f27b57b319b3beec6..4e222f15a5b2b84eb5d55bc79c605510bd89b7b6 100644 (file)
@@ -369,7 +369,8 @@ branch.<name>.rebase::
 
 browser.<tool>.path::
        Override the path for the given tool that may be used to
 
 browser.<tool>.path::
        Override the path for the given tool that may be used to
-       browse HTML help. See '-w' option in linkgit:git-help[1].
+       browse HTML help (see '-w' option in linkgit:git-help[1]) or a
+       working repository in gitweb (see linkgit:git-instaweb[1]).
 
 clean.requireForce::
        A boolean to make git-clean do nothing unless given -f
 
 clean.requireForce::
        A boolean to make git-clean do nothing unless given -f
index ad0723ccc64cc2cb7d0e79a165a68707d3ddfde7..3e4452bc4bc1fe57c75848ccd9c073aeb065a980 100755 (executable)
@@ -274,6 +274,14 @@ webrick)
        ;;
 esac
 
        ;;
 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
 start_httpd
 url=http://127.0.0.1:$port
-test -n "$browser" && "$browser" $url || echo $url
+test -n "$browser" && {
+       init_browser_path "$browser"
+       "$browser_path" $url
+} || echo $url