web--browse: support /usr/bin/cygstart on Cygwin

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>

Yaakov Selkowitz committed Jun 21, 2013 at 02:24 UTC cc2f6b686575e2b7664d22d1266fc55197bc7e81
2 files changed +9 -3
Documentation/git-web--browse.txt
+1
@@ -34,6 +34,7 @@ The following browsers (or commands) are currently supported:
34 * dillo
35 * open (this is the default under Mac OS X GUI)
36 * start (this is the default under MinGW)
37 +* cygstart (this is the default under Cygwin)
38
39 Custom commands may also be specified.
40
git-web--browse.sh
+8 -3
@@ -32,8 +32,9 @@ valid_custom_tool()
32 valid_tool() {
33 case "$1" in
34 firefox | iceweasel | seamonkey | iceape | \
35 - chrome | google-chrome | chromium | chromium-browser |\
36 - konqueror | opera | w3m | elinks | links | lynx | dillo | open | start)
35 + chrome | google-chrome | chromium | chromium-browser | \
36 + konqueror | opera | w3m | elinks | links | lynx | dillo | open | \
37 + start | cygstart)
38 ;; # happy
39 *)
40 valid_custom_tool "$1" || return 1
@@ -127,6 +128,10 @@ if test -z "$browser" ; then
128 if test -x /bin/start; then
129 browser_candidates="start $browser_candidates"
130 fi
131 + # /usr/bin/cygstart indicates Cygwin
132 + if test -x /usr/bin/cygstart; then
133 + browser_candidates="cygstart $browser_candidates"
134 + fi
135
136 for i in $browser_candidates; do
137 init_browser_path $i
@@ -174,7 +179,7 @@ konqueror)
179 ;;
180 esac
181 ;;
177 -w3m|elinks|links|lynx|open)
182 +w3m|elinks|links|lynx|open|cygstart)
183 "$browser_path" "$@"
184 ;;
185 start)