web--browse: better support for chromium
On Debian-based distributions, Chromium the browser is available under the name chromium-browser rather than chromium, to prevent conflicts with the Chromium B.S.U. game. Look for chromium-browser first when setting the path for chromium, and also add chromium-browser as a supported browser name. Document the dual-name support, and mention the dual-name support for (google-)chrome too. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Giuseppe Bilotta committed
Dec 3, 2010 at 17:47 UTC
14ea67c0071804b7eb73cca35c87860f8fc6db95
2 files changed
+13
-7
Documentation/git-web--browse.txt
+2
-2
@@ -22,8 +22,8 @@ The following browsers (or commands) are currently supported:
22
* iceweasel
23
* seamonkey
24
* iceape
25
-* chromium
26
-* google-chrome
25
+* chromium (also supported as chromium-browser)
26
+* google-chrome (also supported as chrome)
27
* konqueror (this is the default under KDE, see 'Note about konqueror' below)
28
* opera
29
* w3m (this is the default outside graphical environments)
git-web--browse.sh
+11
-5
@@ -31,7 +31,8 @@ valid_custom_tool()
31
32
valid_tool() {
33
case "$1" in
34
- firefox | iceweasel | seamonkey | iceape | chrome | google-chrome | chromium | \
34
+ firefox | iceweasel | seamonkey | iceape | \
35
+ chrome | google-chrome | chromium | chromium-browser |\
36
konqueror | opera | w3m | elinks | links | lynx | dillo | open | start)
37
;; # happy
38
*)
@@ -42,7 +43,13 @@ valid_tool() {
43
44
init_browser_path() {
45
browser_path=$(git config "browser.$1.path")
45
- test -z "$browser_path" && browser_path="$1"
46
+ if test -z "$browser_path" &&
47
+ test "$1" = chromium &&
48
+ type chromium-browser >/dev/null 2>&1
49
+ then
50
+ browser_path=chromium-browser
51
+ fi
52
+ : ${browser_path:="$1"}
53
}
54
55
while test $# != 0
@@ -104,7 +111,7 @@ fi
111
112
if test -z "$browser" ; then
113
if test -n "$DISPLAY"; then
107
- browser_candidates="firefox iceweasel google-chrome chrome chromium konqueror opera seamonkey iceape w3m elinks links lynx dillo"
114
+ browser_candidates="firefox iceweasel google-chrome chrome chromium chromium-browser konqueror opera seamonkey iceape w3m elinks links lynx dillo"
115
if test "$KDE_FULL_SESSION" = "true"; then
116
browser_candidates="konqueror $browser_candidates"
117
fi
@@ -147,8 +154,7 @@ firefox|iceweasel|seamonkey|iceape)
154
test "$vers" -lt 2 && NEWTAB=''
155
"$browser_path" $NEWTAB "$@" &
156
;;
150
-google-chrome|chrome|chromium)
151
- # Actual command for chromium is chromium-browser.
157
+google-chrome|chrome|chromium|chromium-browser)
158
# No need to specify newTab. It's default in chromium
159
eval "$browser_path" "$@" &
160
;;