</div>\r
<h2>SYNOPSIS</h2>\r
<div class="sectionbody">\r
-<p><em>git-blame</em> [-c] [-l] [-t] [-S <revs-file>] [--] <file> [<rev>]</p>\r
+<p><em>git-blame</em> [-c] [-l] [-t] [-f] [-n] [-p] [-S <revs-file>] [--] <file> [<rev>]</p>\r
</div>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
</p>\r
</dd>\r
<dt>\r
+-f, --show-name\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show filename in the original commit. By default\r
+ filename is shown if there is any line that came from a\r
+ file with different name, due to rename detection.\r
+</p>\r
+</dd>\r
+<dt>\r
+-n, --show-number\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show line number in the original commit (Default: off).\r
+</p>\r
+</dd>\r
+<dt>\r
+-p, --porcelain\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show in a format designed for machine consumption.\r
+</p>\r
+</dd>\r
+<dt>\r
-h, --help\r
</dt>\r
<dd>\r
</dd>\r
</dl>\r
</div>\r
+<h2>THE PORCELAIN FORMAT</h2>\r
+<div class="sectionbody">\r
+<p>In this format, each line is output after a header; the\r
+header at the minumum has the first line which has:</p>\r
+<ul>\r
+<li>\r
+<p>\r
+40-byte SHA-1 of the commit the line is attributed to;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+the line number of the line in the original file;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+the line number of the line in the final file;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+on a line that starts a group of line from a different\r
+ commit than the previous one, the number of lines in this\r
+ group. On subsequent lines this field is absent.\r
+</p>\r
+</li>\r
+</ul>\r
+<p>This header line is followed by the following information\r
+at least once for each commit:</p>\r
+<ul>\r
+<li>\r
+<p>\r
+author name ("author"), email ("author-mail"), time\r
+ ("author-time"), and timezone ("author-tz"); similarly\r
+ for committer.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+filename in the commit the line is attributed to.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+the first line of the commit log message ("summary").\r
+</p>\r
+</li>\r
+</ul>\r
+<p>The contents of the actual line is output after the above\r
+header, prefixed by a TAB. This is to allow adding more\r
+header elements later.</p>\r
+</div>\r
<h2>SEE ALSO</h2>\r
<div class="sectionbody">\r
<p><a href="git-annotate.html">git-annotate(1)</a></p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 03-Oct-2006 08:40:53 UTC\r
+Last updated 25-Oct-2006 22:55:21 UTC\r
</div>\r
</div>\r
</body>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 7.0.2" />\r
+<style type="text/css">\r
+/* Debug borders */\r
+p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
+/*\r
+ border: 1px solid red;\r
+*/\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a { color: blue; }\r
+a:visited { color: fuchsia; }\r
+\r
+em {\r
+ font-style: italic;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+}\r
+\r
+tt {\r
+ color: navy;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ font-family: sans-serif;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ border-bottom: 2px solid silver;\r
+ padding-top: 0.5em;\r
+}\r
+\r
+div.sectionbody {\r
+ font-family: serif;\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+span#author {\r
+ color: #527bbd;\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ font-size: 1.2em;\r
+}\r
+span#email {\r
+}\r
+span#revision {\r
+ font-family: sans-serif;\r
+}\r
+\r
+div#footer {\r
+ font-family: sans-serif;\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+div#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+div#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+div#preamble,\r
+div.tableblock, div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-right: 10%;\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.5em;\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid silver;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid silver;\r
+ background: #f4f4f4;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock > div.content {\r
+ padding-left: 2.0em;\r
+}\r
+div.quoteblock .attribution {\r
+ text-align: right;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 2px solid silver;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 2px solid silver;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.verseblock div.content {\r
+ white-space: pre;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+div.imageblock img { border: 1px solid silver; }\r
+span.image img { border-style: none; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: italic;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.olist2 {\r
+ list-style-type: lower-alpha;\r
+}\r
+\r
+div.tableblock > table {\r
+ border-color: #527bbd;\r
+ border-width: 3px;\r
+}\r
+thead {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+}\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+\r
+div.hlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+td.hlist1 {\r
+ vertical-align: top;\r
+ font-style: italic;\r
+ padding-right: 0.8em;\r
+}\r
+td.hlist2 {\r
+ vertical-align: top;\r
+}\r
+\r
+@media print {\r
+ div#footer-badges { display: none; }\r
+}\r
+include::./stylesheets/xhtml11-manpage.css[]\r
+/* Workarounds for IE6's broken and incomplete CSS2. */\r
+\r
+div.sidebar-content {\r
+ background: #ffffee;\r
+ border: 1px solid silver;\r
+ padding: 0.5em;\r
+}\r
+div.sidebar-title, div.image-title {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ margin-top: 0.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+div.listingblock div.content {\r
+ border: 1px solid silver;\r
+ background: #f4f4f4;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock-content {\r
+ padding-left: 2.0em;\r
+}\r
+\r
+div.exampleblock-content {\r
+ border-left: 2px solid silver;\r
+ padding-left: 0.5em;\r
+}\r
+</style>\r
+<title>git-for-each-ref(1)</title>\r
+</head>\r
+<body>\r
+<div id="header">\r
+<h1>\r
+git-for-each-ref(1) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>git-for-each-ref -\r
+ Output information on each ref\r
+</p>\r
+</div>\r
+</div>\r
+<h2>SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<p><em>git-for-each-ref</em> [--count=<count>]<strong> [--shell|--perl|--python] [--sort=<key>]</strong> [--format=<format>] [<pattern>]</p>\r
+</div>\r
+<h2>DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<p>Iterate over all refs that match <tt><pattern></tt> and show them\r
+according to the given <tt><format></tt>, after sorting them according\r
+to the given set of <tt><key>`s. If </tt><max><tt> is given, stop after\r
+showing that many refs. The interporated values in </tt><format>`\r
+can optionally be quoted as string literals in the specified\r
+host language allowing their direct evaluation in that language.</p>\r
+</div>\r
+<h2>OPTIONS</h2>\r
+<div class="sectionbody">\r
+<dl>\r
+<dt>\r
+<count>\r
+</dt>\r
+<dd>\r
+<p>\r
+ By default the command shows all refs that match\r
+ <tt><pattern></tt>. This option makes it stop after showing\r
+ that many refs.\r
+</p>\r
+</dd>\r
+<dt>\r
+<key>\r
+</dt>\r
+<dd>\r
+<p>\r
+ A field name to sort on. Prefix <tt>-</tt> to sort in\r
+ descending order of the value. When unspecified,\r
+ <tt>refname</tt> is used. More than one sort keys can be\r
+ given.\r
+</p>\r
+</dd>\r
+<dt>\r
+<format>\r
+</dt>\r
+<dd>\r
+<p>\r
+ A string that interpolates <tt>%(fieldname)</tt> from the\r
+ object pointed at by a ref being shown. If <tt>fieldname</tt>\r
+ is prefixed with an asterisk (<tt>*</tt>) and the ref points\r
+ at a tag object, the value for the field in the object\r
+ tag refers is used. When unspecified, defaults to\r
+ <tt>%(refname)</tt>.\r
+</p>\r
+</dd>\r
+<dt>\r
+<pattern>\r
+</dt>\r
+<dd>\r
+<p>\r
+ If given, the name of the ref is matched against this\r
+ using fnmatch(3). Refs that do not match the pattern\r
+ are not shown.\r
+</p>\r
+</dd>\r
+<dt>\r
+--shell, --perl, --python\r
+</dt>\r
+<dd>\r
+<p>\r
+ If given, strings that substitute <tt>%(fieldname)</tt>\r
+ placeholders are quoted as string literals suitable for\r
+ the specified host language. This is meant to produce\r
+ a scriptlet that can directly be `eval`ed.\r
+</p>\r
+</dd>\r
+</dl>\r
+</div>\r
+<h2>FIELD NAMES</h2>\r
+<div class="sectionbody">\r
+<p>Various values from structured fields in referenced objects can\r
+be used to interpolate into the resulting output, or as sort\r
+keys.</p>\r
+<p>For all objects, the following names can be used:</p>\r
+<dl>\r
+<dt>\r
+refname\r
+</dt>\r
+<dd>\r
+<p>\r
+ The name of the ref (the part after $GIT_DIR/refs/).\r
+</p>\r
+</dd>\r
+<dt>\r
+objecttype\r
+</dt>\r
+<dd>\r
+<p>\r
+ The type of the object (<tt>blob</tt>, <tt>tree</tt>, <tt>commit</tt>, <tt>tag</tt>).\r
+</p>\r
+</dd>\r
+<dt>\r
+objectsize\r
+</dt>\r
+<dd>\r
+<p>\r
+ The size of the object (the same as <tt>git-cat-file -s</tt> reports).\r
+</p>\r
+</dd>\r
+<dt>\r
+objectname\r
+</dt>\r
+<dd>\r
+<p>\r
+ The object name (aka SHA-1).\r
+</p>\r
+</dd>\r
+</dl>\r
+<p>In addition to the above, for commit and tag objects, the header\r
+field names (<tt>tree</tt>, <tt>parent</tt>, <tt>object</tt>, <tt>type</tt>, and <tt>tag</tt>) can\r
+be used to specify the value in the header field.</p>\r
+<p>Fields that have name-email-date tuple as its value (<tt>author</tt>,\r
+<tt>committer</tt>, and <tt>tagger</tt>) can be suffixed with <tt>name</tt>, <tt>email</tt>,\r
+and <tt>date</tt> to extract the named component.</p>\r
+<p>The first line of the message in a commit and tag object is\r
+<tt>subject</tt>, the remaining lines are <tt>body</tt>. The whole message\r
+is <tt>contents</tt>.</p>\r
+<p>For sorting purposes, fields with numeric values sort in numeric\r
+order (<tt>objectsize</tt>, <tt>authordate</tt>, <tt>committerdate</tt>, <tt>taggerdate</tt>).\r
+All other fields are used to sort in their byte-value order.</p>\r
+<p>In any case, a field name that refers to a field inapplicable to\r
+the object referred by the ref does not cause an error. It\r
+returns an empty string instead.</p>\r
+</div>\r
+<h2>EXAMPLES</h2>\r
+<div class="sectionbody">\r
+<p>An example directly producing formatted text. Show the most recent\r
+3 tagged commits::</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>#!/bin/sh\r
+\r
+git-for-each-ref --count=3 --sort='-*authordate' \\r
+--format='From: %(*authorname) %(*authoremail)\r
+Subject: %(*subject)\r
+Date: %(*authordate)\r
+Ref: %(*refname)\r
+\r
+%(*body)\r
+' 'refs/tags'</tt></pre>\r
+</div></div>\r
+<p>A simple example showing the use of shell eval on the output,\r
+demonstrating the use of --shell. List the prefixes of all heads::</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>#!/bin/sh\r
+\r
+git-for-each-ref --shell --format="ref=%(refname)" refs/heads | \\r
+while read entry\r
+do\r
+ eval "$entry"\r
+ echo `dirname $ref`\r
+done</tt></pre>\r
+</div></div>\r
+<p>A bit more elaborate report on tags, demonstrating that the format\r
+may be an entire script::</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>#!/bin/sh\r
+\r
+fmt='\r
+ r=%(refname)\r
+ t=%(*objecttype)\r
+ T=${r#refs/tags/}\r
+\r
+ o=%(*objectname)\r
+ n=%(*authorname)\r
+ e=%(*authoremail)\r
+ s=%(*subject)\r
+ d=%(*authordate)\r
+ b=%(*body)\r
+\r
+ kind=Tag\r
+ if test "z$t" = z\r
+ then\r
+ # could be a lightweight tag\r
+ t=%(objecttype)\r
+ kind="Lightweight tag"\r
+ o=%(objectname)\r
+ n=%(authorname)\r
+ e=%(authoremail)\r
+ s=%(subject)\r
+ d=%(authordate)\r
+ b=%(body)\r
+ fi\r
+ echo "$kind $T points at a $t object $o"\r
+ if test "z$t" = zcommit\r
+ then\r
+ echo "The commit was authored by $n $e\r
+at $d, and titled\r
+\r
+ $s\r
+\r
+Its message reads as:\r
+"\r
+ echo "$b" | sed -e "s/^/ /"\r
+ echo\r
+ fi\r
+'\r
+\r
+eval=`git-for-each-ref --shell --format="$fmt" \\r
+ --sort='*objecttype' \\r
+ --sort=-taggerdate \\r
+ refs/tags`\r
+eval "$eval"</tt></pre>\r
+</div></div>\r
+</div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+Last updated 25-Oct-2006 22:55:22 UTC\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+git-for-each-ref(1)
+===================
+
+NAME
+----
+git-for-each-ref - Output information on each ref
+
+SYNOPSIS
+--------
+'git-for-each-ref' [--count=<count>]* [--shell|--perl|--python] [--sort=<key>]* [--format=<format>] [<pattern>]
+
+DESCRIPTION
+-----------
+
+Iterate over all refs that match `<pattern>` and show them
+according to the given `<format>`, after sorting them according
+to the given set of `<key>`s. If `<max>` is given, stop after
+showing that many refs. The interporated values in `<format>`
+can optionally be quoted as string literals in the specified
+host language allowing their direct evaluation in that language.
+
+OPTIONS
+-------
+<count>::
+ By default the command shows all refs that match
+ `<pattern>`. This option makes it stop after showing
+ that many refs.
+
+<key>::
+ A field name to sort on. Prefix `-` to sort in
+ descending order of the value. When unspecified,
+ `refname` is used. More than one sort keys can be
+ given.
+
+<format>::
+ A string that interpolates `%(fieldname)` from the
+ object pointed at by a ref being shown. If `fieldname`
+ is prefixed with an asterisk (`*`) and the ref points
+ at a tag object, the value for the field in the object
+ tag refers is used. When unspecified, defaults to
+ `%(refname)`.
+
+<pattern>::
+ If given, the name of the ref is matched against this
+ using fnmatch(3). Refs that do not match the pattern
+ are not shown.
+
+--shell, --perl, --python::
+ If given, strings that substitute `%(fieldname)`
+ placeholders are quoted as string literals suitable for
+ the specified host language. This is meant to produce
+ a scriptlet that can directly be `eval`ed.
+
+
+FIELD NAMES
+-----------
+
+Various values from structured fields in referenced objects can
+be used to interpolate into the resulting output, or as sort
+keys.
+
+For all objects, the following names can be used:
+
+refname::
+ The name of the ref (the part after $GIT_DIR/refs/).
+
+objecttype::
+ The type of the object (`blob`, `tree`, `commit`, `tag`).
+
+objectsize::
+ The size of the object (the same as `git-cat-file -s` reports).
+
+objectname::
+ The object name (aka SHA-1).
+
+In addition to the above, for commit and tag objects, the header
+field names (`tree`, `parent`, `object`, `type`, and `tag`) can
+be used to specify the value in the header field.
+
+Fields that have name-email-date tuple as its value (`author`,
+`committer`, and `tagger`) can be suffixed with `name`, `email`,
+and `date` to extract the named component.
+
+The first line of the message in a commit and tag object is
+`subject`, the remaining lines are `body`. The whole message
+is `contents`.
+
+For sorting purposes, fields with numeric values sort in numeric
+order (`objectsize`, `authordate`, `committerdate`, `taggerdate`).
+All other fields are used to sort in their byte-value order.
+
+In any case, a field name that refers to a field inapplicable to
+the object referred by the ref does not cause an error. It
+returns an empty string instead.
+
+
+EXAMPLES
+--------
+
+An example directly producing formatted text. Show the most recent
+3 tagged commits::
+
+------------
+#!/bin/sh
+
+git-for-each-ref --count=3 --sort='-*authordate' \
+--format='From: %(*authorname) %(*authoremail)
+Subject: %(*subject)
+Date: %(*authordate)
+Ref: %(*refname)
+
+%(*body)
+' 'refs/tags'
+------------
+
+
+A simple example showing the use of shell eval on the output,
+demonstrating the use of --shell. List the prefixes of all heads::
+------------
+#!/bin/sh
+
+git-for-each-ref --shell --format="ref=%(refname)" refs/heads | \
+while read entry
+do
+ eval "$entry"
+ echo `dirname $ref`
+done
+------------
+
+
+A bit more elaborate report on tags, demonstrating that the format
+may be an entire script::
+------------
+#!/bin/sh
+
+fmt='
+ r=%(refname)
+ t=%(*objecttype)
+ T=${r#refs/tags/}
+
+ o=%(*objectname)
+ n=%(*authorname)
+ e=%(*authoremail)
+ s=%(*subject)
+ d=%(*authordate)
+ b=%(*body)
+
+ kind=Tag
+ if test "z$t" = z
+ then
+ # could be a lightweight tag
+ t=%(objecttype)
+ kind="Lightweight tag"
+ o=%(objectname)
+ n=%(authorname)
+ e=%(authoremail)
+ s=%(subject)
+ d=%(authordate)
+ b=%(body)
+ fi
+ echo "$kind $T points at a $t object $o"
+ if test "z$t" = zcommit
+ then
+ echo "The commit was authored by $n $e
+at $d, and titled
+
+ $s
+
+Its message reads as:
+"
+ echo "$b" | sed -e "s/^/ /"
+ echo
+ fi
+'
+
+eval=`git-for-each-ref --shell --format="$fmt" \
+ --sort='*objecttype' \
+ --sort=-taggerdate \
+ refs/tags`
+eval "$eval"
+------------