@matheusbsbs / matheus-bagliano / commits / 969702a957
Fork 0

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>

Jay Soffian committed Feb 14, 2008 at 03:36 UTC 969702a9575ada3bcc510ce2e44cb00b8325ecaa
1 file changed +6 -2
git-help--browse.sh
+6 -2
@@ -30,7 +30,7 @@ test -f "$html_dir/git.html" || die "No documentation directory found."
30
31 valid_tool() {
32 case "$1" in
33 - firefox | iceweasel | konqueror | w3m | links | lynx | dillo)
33 + firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open)
34 ;; # happy
35 *)
36 return 1
@@ -94,6 +94,10 @@ if test -z "$browser" ; then
94 else
95 browser_candidates="w3m links lynx"
96 fi
97 + # SECURITYSESSIONID indicates an OS X GUI login session
98 + if test -n "$SECURITYSESSIONID"; then
99 + browser_candidates="open $browser_candidates"
100 + fi
101
102 for i in $browser_candidates; do
103 init_browser_path $i
@@ -140,7 +144,7 @@ case "$browser" in
144 ;;
145 esac
146 ;;
143 - w3m|links|lynx)
147 + w3m|links|lynx|open)
148 eval "$browser_path" $pages
149 ;;
150 dillo)