summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jay Soffian <jaysoffian@gmail.com>2008-02-14 03:36:14 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-02-16 00:45:57 -0800
commit969702a9575ada3bcc510ce2e44cb00b8325ecaa (patch)
treed64ee212ec303123f2f5bd2da658f1b9606bf2f4
parentMerge branch 'maint' (diff)
downloadtgif-969702a9575ada3bcc510ce2e44cb00b8325ecaa.tar.xz
git-help--browse: improve browser support under OS X
/usr/bin/open <document> is used under OS X to open a document as if the user had double-clicked on the file's icon (i.e. HTML files are opened w/the user's default browser). Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-help--browse.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-help--browse.sh b/git-help--browse.sh
index 10b0a36a3d..84e37ef279 100755
--- a/git-help--browse.sh
+++ b/git-help--browse.sh
@@ -30,7 +30,7 @@ test -f "$html_dir/git.html" || die "No documentation directory found."
valid_tool() {
case "$1" in
- firefox | iceweasel | konqueror | w3m | links | lynx | dillo)
+ firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open)
;; # happy
*)
return 1
@@ -94,6 +94,10 @@ if test -z "$browser" ; then
else
browser_candidates="w3m links lynx"
fi
+ # SECURITYSESSIONID indicates an OS X GUI login session
+ if test -n "$SECURITYSESSIONID"; then
+ browser_candidates="open $browser_candidates"
+ fi
for i in $browser_candidates; do
init_browser_path $i
@@ -140,7 +144,7 @@ case "$browser" in
;;
esac
;;
- w3m|links|lynx)
+ w3m|links|lynx|open)
eval "$browser_path" $pages
;;
dillo)