All pastes #1978764 Raw Edit

git-web--browse.xml

public text v1 · immutable
#1978764 ·published 2010-11-01 15:29 UTC
rendered paste body
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<?asciidoc-toc?>
<?asciidoc-numbered?>
<refentry>
<refmeta>
<refentrytitle>git-web&#45;&#45;browse</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="source">Git</refmiscinfo>
<refmiscinfo class="version">1.7.3.2.146.gca209</refmiscinfo>
<refmiscinfo class="manual">Git Manual</refmiscinfo>
</refmeta>
<refnamediv>
  <refname>git-web--browse</refname>
  <refpurpose>git helper script to launch a web browser</refpurpose>
</refnamediv>
<refsynopsisdiv id="_synopsis">
<simpara><emphasis>git web&#45;&#45;browse</emphasis> [OPTIONS] URL/FILE &#8230;</simpara>
</refsynopsisdiv>
<refsect1 id="_description">
<title>DESCRIPTION</title>
<simpara>This script tries, as much as possible, to display the URLs and FILEs
that are passed as arguments, as HTML pages in new tabs on an already
opened web browser.</simpara>
<simpara>The following browsers (or commands) are currently supported:</simpara>
<itemizedlist>
<listitem>
<simpara>
firefox (this is the default under X Window when not using KDE)
</simpara>
</listitem>
<listitem>
<simpara>
iceweasel
</simpara>
</listitem>
<listitem>
<simpara>
konqueror (this is the default under KDE, see <emphasis>Note about konqueror</emphasis> below)
</simpara>
</listitem>
<listitem>
<simpara>
w3m (this is the default outside graphical environments)
</simpara>
</listitem>
<listitem>
<simpara>
links
</simpara>
</listitem>
<listitem>
<simpara>
lynx
</simpara>
</listitem>
<listitem>
<simpara>
dillo
</simpara>
</listitem>
<listitem>
<simpara>
open (this is the default under Mac OS X GUI)
</simpara>
</listitem>
<listitem>
<simpara>
start (this is the default under MinGW)
</simpara>
</listitem>
</itemizedlist>
<simpara>Custom commands may also be specified.</simpara>
</refsect1>
<refsect1 id="_options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
-b &lt;browser&gt;
</term>
<term>
--browser=&lt;browser&gt;
</term>
<listitem>
<simpara>
        Use the specified browser. It must be in the list of supported
        browsers.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-t &lt;browser&gt;
</term>
<term>
--tool=&lt;browser&gt;
</term>
<listitem>
<simpara>
        Same as above.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-c &lt;conf.var&gt;
</term>
<term>
--config=&lt;conf.var&gt;
</term>
<listitem>
<simpara>
        CONF.VAR is looked up in the git config files. If it&#8217;s set,
        then its value specifies the browser that should be used.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="_configuration_variables">
<title>CONFIGURATION VARIABLES</title>
<refsect2 id="_conf_var_from_c_option_and_web_browser">
<title>CONF.VAR (from -c option) and web.browser</title>
<simpara>The web browser can be specified using a configuration variable passed
with the -c (or --config) command line option, or the <emphasis>web.browser</emphasis>
configuration variable if the former is not used.</simpara>
</refsect2>
<refsect2 id="_browser_lt_tool_gt_path">
<title>browser.&lt;tool&gt;.path</title>
<simpara>You can explicitly provide a full path to your preferred browser by
setting the configuration variable <emphasis>browser.&lt;tool&gt;.path</emphasis>. For example,
you can configure the absolute path to firefox by setting
<emphasis>browser.firefox.path</emphasis>. Otherwise, <emphasis>git web&#8212;browse</emphasis> assumes the tool
is available in PATH.</simpara>
</refsect2>
<refsect2 id="_browser_lt_tool_gt_cmd">
<title>browser.&lt;tool&gt;.cmd</title>
<simpara>When the browser, specified by options or configuration variables, is
not among the supported ones, then the corresponding
<emphasis>browser.&lt;tool&gt;.cmd</emphasis> configuration variable will be looked up. If this
variable exists then <emphasis>git web&#45;&#45;browse</emphasis> will treat the specified tool
as a custom command and will use a shell eval to run the command with
the URLs passed as arguments.</simpara>
</refsect2>
</refsect1>
<refsect1 id="_note_about_konqueror">
<title>Note about konqueror</title>
<simpara>When <emphasis>konqueror</emphasis> is specified by a command line option or a
configuration variable, we launch <emphasis>kfmclient</emphasis> to try to open the HTML
man page on an already opened konqueror in a new tab if possible.</simpara>
<simpara>For consistency, we also try such a trick if <emphasis>browser.konqueror.path</emphasis> is
set to something like <emphasis>A_PATH_TO/konqueror</emphasis>. That means we will try to
launch <emphasis>A_PATH_TO/kfmclient</emphasis> instead.</simpara>
<simpara>If you really want to use <emphasis>konqueror</emphasis>, then you can use something like
the following:</simpara>
<literallayout>
&#10;.ft C&#10;        [web]
                browser = konq

        [browser "konq"]
                cmd = A_PATH_TO/konqueror&#10;.ft&#10;
</literallayout>
<refsect2 id="_note_about_git_config_global">
<title>Note about git-config --global</title>
<simpara>Note that these configuration variables should probably be set using
the <emphasis>--global</emphasis> flag, for example like this:</simpara>
<literallayout>
&#10;.ft C&#10;$ git config --global web.browser firefox&#10;.ft&#10;
</literallayout>
<simpara>as they are probably more user specific than repository specific.
See <citerefentry>
<refentrytitle>git-config</refentrytitle><manvolnum>1</manvolnum>
</citerefentry> for more information about this.</simpara>
</refsect2>
</refsect1>
<refsect1 id="_author">
<title>Author</title>
<simpara>Written by Christian Couder &lt;<ulink url="mailto:chriscool@tuxfamily.org">chriscool@tuxfamily.org</ulink>&gt; and the git-list
&lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;, based on <emphasis>git mergetool</emphasis> by Theodore Y. Ts&#8217;o.</simpara>
</refsect1>
<refsect1 id="_documentation">
<title>Documentation</title>
<simpara>Documentation by Christian Couder &lt;<ulink url="mailto:chriscool@tuxfamily.org">chriscool@tuxfamily.org</ulink>&gt; and the
git-list &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;.</simpara>
</refsect1>
<refsect1 id="_git">
<title>GIT</title>
<simpara>Part of the <citerefentry>
<refentrytitle>git</refentrytitle><manvolnum>1</manvolnum>
</citerefentry> suite</simpara>
</refsect1>
</refentry>