]> git.ipfire.org Git - thirdparty/git.git/commitdiff
web--browse: Add support for xdg-open
authorRüdiger Sonderfeld <ruediger@c-plusplus.de>
Sat, 26 Oct 2013 17:43:54 +0000 (19:43 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Oct 2013 20:54:15 +0000 (13:54 -0700)
xdg-open is a tool similar to git-web--browse.  It opens a file or URL in the
user's preferred application.  It could probably be made default at least on
Linux with a graphical environment.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-web--browse.txt
git-web--browse.sh

index 5aec4ecffb8c9dd58c444319d24064c8fee1770e..2de575f5beed10ed616289d88929c466a0fcb296 100644 (file)
@@ -35,6 +35,7 @@ The following browsers (or commands) are currently supported:
 * open (this is the default under Mac OS X GUI)
 * start (this is the default under MinGW)
 * cygstart (this is the default under Cygwin)
+* xdg-open
 
 Custom commands may also be specified.
 
index 1d72ec760e9d69e0fc29a699fa60be945f872a93..ebdfba6c94db947f66add0c1b4840319c12252ea 100755 (executable)
@@ -34,7 +34,7 @@ valid_tool() {
        firefox | iceweasel | seamonkey | iceape | \
        chrome | google-chrome | chromium | chromium-browser | \
        konqueror | opera | w3m | elinks | links | lynx | dillo | open | \
-       start | cygstart)
+       start | cygstart | xdg-open)
                ;; # happy
        *)
                valid_custom_tool "$1" || return 1
@@ -112,7 +112,7 @@ fi
 
 if test -z "$browser" ; then
        if test -n "$DISPLAY"; then
-               browser_candidates="firefox iceweasel google-chrome chrome chromium chromium-browser konqueror opera seamonkey iceape w3m elinks links lynx dillo"
+               browser_candidates="firefox iceweasel google-chrome chrome chromium chromium-browser konqueror opera seamonkey iceape w3m elinks links lynx dillo xdg-open"
                if test "$KDE_FULL_SESSION" = "true"; then
                        browser_candidates="konqueror $browser_candidates"
                fi
@@ -179,7 +179,7 @@ konqueror)
                ;;
        esac
        ;;
-w3m|elinks|links|lynx|open|cygstart)
+w3m|elinks|links|lynx|open|cygstart|xdg-open)
        "$browser_path" "$@"
        ;;
 start)