]> git.scripts.mit.edu Git - git.git/commitdiff
web--browse: support /usr/bin/cygstart on Cygwin
authorYaakov Selkowitz <yselkowitz@users.sourceforge.net>
Fri, 21 Jun 2013 07:24:32 +0000 (02:24 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Jun 2013 16:05:15 +0000 (09:05 -0700)
While both GUI and console Cygwin browsers do exist, anecdotal evidence
suggests most users rely on their native Windows browser.  cygstart,
which is a long-standing part of the base Cygwin installation, will
cause the page to be opened in the default Windows browser (the one
registered to open .html files).

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-web--browse.txt
git-web--browse.sh

index ba79cb4f35a1f525c98c0bc6b95acf4c46ddc1dc..5aec4ecffb8c9dd58c444319d24064c8fee1770e 100644 (file)
@@ -34,6 +34,7 @@ The following browsers (or commands) are currently supported:
 * dillo
 * open (this is the default under Mac OS X GUI)
 * start (this is the default under MinGW)
+* cygstart (this is the default under Cygwin)
 
 Custom commands may also be specified.
 
index 9f446798d473cee7dedc82d5d2c820cb0967b375..1d72ec760e9d69e0fc29a699fa60be945f872a93 100755 (executable)
@@ -32,8 +32,9 @@ valid_custom_tool()
 valid_tool() {
        case "$1" in
        firefox | iceweasel | seamonkey | iceape | \
-       chrome | google-chrome | chromium | chromium-browser |\
-       konqueror | opera | w3m | elinks | links | lynx | dillo | open | start)
+       chrome | google-chrome | chromium | chromium-browser | \
+       konqueror | opera | w3m | elinks | links | lynx | dillo | open | \
+       start | cygstart)
                ;; # happy
        *)
                valid_custom_tool "$1" || return 1
@@ -127,6 +128,10 @@ if test -z "$browser" ; then
        if test -x /bin/start; then
                browser_candidates="start $browser_candidates"
        fi
+       # /usr/bin/cygstart indicates Cygwin
+       if test -x /usr/bin/cygstart; then
+               browser_candidates="cygstart $browser_candidates"
+       fi
 
        for i in $browser_candidates; do
                init_browser_path $i
@@ -174,7 +179,7 @@ konqueror)
                ;;
        esac
        ;;
-w3m|elinks|links|lynx|open)
+w3m|elinks|links|lynx|open|cygstart)
        "$browser_path" "$@"
        ;;
 start)