Skip to content

Commit ab989ad

Browse files
chriscoolgitster
authored andcommitted
instaweb: use 'browser.<tool>.path' config option if it's set.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f7ff09d commit ab989ad

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Documentation/config.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ branch.<name>.rebase::
369369

370370
browser.<tool>.path::
371371
Override the path for the given tool that may be used to
372-
browse HTML help. See '-w' option in linkgit:git-help[1].
372+
browse HTML help (see '-w' option in linkgit:git-help[1]) or a
373+
working repository in gitweb (see linkgit:git-instaweb[1]).
373374

374375
clean.requireForce::
375376
A boolean to make git-clean do nothing unless given -f

git-instaweb.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,14 @@ webrick)
274274
;;
275275
esac
276276

277+
init_browser_path() {
278+
browser_path="`git config browser.$1.path`"
279+
test -z "$browser_path" && browser_path="$1"
280+
}
281+
277282
start_httpd
278283
url=http://127.0.0.1:$port
279-
test -n "$browser" && "$browser" $url || echo $url
284+
test -n "$browser" && {
285+
init_browser_path "$browser"
286+
"$browser_path" $url
287+
} || echo $url

0 commit comments

Comments
 (0)