[PATCH] git-web--browse: improve browser support under OS X

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jay Soffian <jaysoffian@xxxxxxxxx>

/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@xxxxxxxxx>
---
 Documentation/git-help.txt |    1 +
 git-web--browse.sh         |    7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt
index ad41aab..897868a 100644
--- a/Documentation/git-help.txt
+++ b/Documentation/git-help.txt
@@ -68,6 +68,7 @@ The following browsers are currently supported by 'git-web--browse':
 * links
 * lynx
 * dillo
+* open (OS X only, where it is the default)
 
 CONFIGURATION VARIABLES
 -----------------------
diff --git a/git-web--browse.sh b/git-web--browse.sh
index 8ed489d..1927c3b 100755
--- a/git-web--browse.sh
+++ b/git-web--browse.sh
@@ -25,7 +25,7 @@ NONGIT_OK=Yes
 
 valid_tool() {
 	case "$1" in
-		firefox | iceweasel | konqueror | w3m | links | lynx | dillo)
+		firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open)
 			;; # happy
 		*)
 			return 1
@@ -104,6 +104,9 @@ if test -z "$browser" ; then
     else
 	browser_candidates="w3m links lynx"
     fi
+    if test "$(uname)" = "Darwin" && test -n "$SECURITYSESSIONID"; then
+	browser_candidates="open $browser_candidates"
+    fi
 
     for i in $browser_candidates; do
 	init_browser_path $i
@@ -147,7 +150,7 @@ case "$browser" in
 		;;
 	esac
 	;;
-    w3m|links|lynx)
+    w3m|links|lynx|open)
 	eval "$browser_path" "$@"
 	;;
     dillo)
-- 
1.5.4.1221.gf32f1

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux