Skip to content

Commit

Permalink
git-help--browse: improve browser support under OS X
Browse files Browse the repository at this point in the history
/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>
  • Loading branch information
Jay Soffian authored and Junio C Hamano committed Feb 16, 2008
1 parent d555858 commit 969702a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-help--browse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -140,7 +144,7 @@ case "$browser" in
;;
esac
;;
w3m|links|lynx)
w3m|links|lynx|open)
eval "$browser_path" $pages
;;
dillo)
Expand Down

0 comments on commit 969702a

Please sign in to comment.