git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, chriscool@tuxfamily.org
Subject: [PATCH updated] git-help--browse: improve browser support under OS X
Date: Thu, 14 Feb 2008 03:36:14 -0500	[thread overview]
Message-ID: <1202978174-77648-1-git-send-email-jaysoffian@gmail.com> (raw)

/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>
---
This is the original patch, but based off master (help--browse instead
of web--browse) per jh. I also added the comment about SECURITYSESSIONID
environment variable per cc.

 git-help--browse.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/git-help--browse.sh b/git-help--browse.sh
index 10b0a36..84e37ef 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)
-- 
1.5.4.1.1281.g75df

                 reply	other threads:[~2008-02-14  8:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1202978174-77648-1-git-send-email-jaysoffian@gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).