git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
jaysoffian+git@gmail.com <jaysoffian+git@gmail.com>
Date
Feb 11, 2008, 02:24 UTC
Message-ID
<1202696664-1565-1-git-send-email-jaysoffian+git@gmail.com>
In-Reply-To
<1202505794-13409-1-git-send-email-jaysoffian+git@gmail.com>
From: Jay Soffian <jaysoffian@gmail.com>

/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>
---
 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
Previous: Jay SoffianNext: Junio C Hamano
Message 9 of 17 in “Improve git-help--browse browser support under OS X”
  1. Improve git-help--browse browser support under OS Xjaysoffian+git@gmail.com, Feb 8, 2008
  2. Dmitry PotapovFeb 9, 2008
  3. Jay SoffianFeb 10, 2008
  4. Dmitry PotapovFeb 10, 2008
  5. Christian CouderFeb 10, 2008
  6. Jay SoffianFeb 11, 2008
  7. Christian CouderFeb 11, 2008
  8. Jay SoffianFeb 11, 2008
  9. git-web--browse: improve browser support under OS Xjaysoffian+git@gmail.com, Feb 11, 2008
  10. Junio C HamanoFeb 11, 2008
  11. Jay SoffianFeb 11, 2008
  12. Jay SoffianFeb 12, 2008
  13. Christian CouderFeb 13, 2008
  14. Junio C HamanoFeb 13, 2008
  15. Pieter de BieFeb 13, 2008
  16. Jay SoffianFeb 14, 2008
  17. Christian CouderFeb 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.