<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.dtd">

<sect2 lang="en" id="git-rev-list(1)">
    <title>git-rev-list(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>git-rev-list(1)</primary>
</indexterm>
<simplesect id="git-rev-list(1)__name">
<title>NAME</title>
<simpara>git-rev-list - Lists commit objects in reverse chronological order</simpara>
</simplesect>
<simplesect id="git-rev-list(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git rev-list</emphasis> [&lt;options&gt;] &lt;commit&gt;&#8230; [--] [&lt;path&gt;&#8230;]</literallayout>
</blockquote>
</simplesect>
<simplesect id="git-rev-list(1)__description">
<title>DESCRIPTION</title>
<simpara>List commits that are reachable by following the <emphasis>parent</emphasis> links from the
given commit(s), but exclude commits that are reachable from the one(s)
given with a <emphasis>&#94;</emphasis> in front of them.  The output is given in reverse
chronological order by default.</simpara>
<simpara>You can think of this as a set operation. Commits reachable from any of
the commits given on the command line form a set, and then commits reachable
from any of the ones given with <emphasis>&#94;</emphasis> in front are subtracted from that
set.  The remaining commits are what comes out in the command's output.
Various other options and paths parameters can be used to further limit the
result.</simpara>
<simpara>Thus, the following command:</simpara>
<screen>$ git rev-list foo bar ^baz</screen>
<simpara>means "list all the commits which are reachable from <emphasis>foo</emphasis> or <emphasis>bar</emphasis>, but
not from <emphasis>baz</emphasis>".</simpara>
<simpara>A special notation "<emphasis>&lt;commit1&gt;</emphasis>..<emphasis>&lt;commit2&gt;</emphasis>" can be used as a
short-hand for "^<emphasis>&lt;commit1&gt;</emphasis> <emphasis>&lt;commit2&gt;</emphasis>". For example, either of
the following may be used interchangeably:</simpara>
<screen>$ git rev-list origin..HEAD
$ git rev-list HEAD ^origin</screen>
<simpara>Another special notation is "<emphasis>&lt;commit1&gt;</emphasis>&#8230;<emphasis>&lt;commit2&gt;</emphasis>" which is useful
for merges.  The resulting set of commits is the symmetric difference
between the two operands.  The following two commands are equivalent:</simpara>
<screen>$ git rev-list A B --not $(git merge-base --all A B)
$ git rev-list A...B</screen>
<simpara><emphasis>rev-list</emphasis> is an essential Git command, since it
provides the ability to build and traverse commit ancestry graphs. For
this reason, it has a lot of different options that enable it to be
used by commands as different as <emphasis>git bisect</emphasis> and
<emphasis>git repack</emphasis>.</simpara>
</simplesect>
<simplesect id="git-rev-list(1)__options">
<title>OPTIONS</title>
<section id="git-rev-list(1)__commit_limiting">
<title>Commit Limiting</title>
<simpara>Besides specifying a range of commits that should be listed using the
special notations explained in the description, additional commit
limiting may be applied.</simpara>
<simpara>Using more options generally further limits the output (e.g.
<emphasis>--since=&lt;date1&gt;</emphasis> limits to commits newer than <emphasis>&lt;date1&gt;</emphasis>, and using it
with <emphasis>--grep=&lt;pattern&gt;</emphasis> further limits to commits whose log message
has a line that matches <emphasis>&lt;pattern&gt;</emphasis>), unless otherwise noted.</simpara>
<simpara>Note that these are applied before commit
ordering and formatting options, such as <emphasis>--reverse</emphasis>.</simpara>
<variablelist>
<varlistentry>
<term>
-&lt;number&gt;
</term>
<term>
-n &lt;number&gt;
</term>
<term>
--max-count=&lt;number&gt;
</term>
<listitem>
<simpara>
        Limit the number of commits to output.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--skip=&lt;number&gt;
</term>
<listitem>
<simpara>
        Skip <emphasis>number</emphasis> commits before starting to show the commit output.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--since=&lt;date&gt;
</term>
<term>
--after=&lt;date&gt;
</term>
<listitem>
<simpara>
        Show commits more recent than a specific date.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--since-as-filter=&lt;date&gt;
</term>
<listitem>
<simpara>
        Show all commits more recent than a specific date. This visits
        all commits in the range, rather than stopping at the first commit which
        is older than a specific date.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--until=&lt;date&gt;
</term>
<term>
--before=&lt;date&gt;
</term>
<listitem>
<simpara>
        Show commits older than a specific date.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--max-age=&lt;timestamp&gt;
</term>
<term>
--min-age=&lt;timestamp&gt;
</term>
<listitem>
<simpara>
        Limit the commits output to specified time range.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--author=&lt;pattern&gt;
</term>
<term>
--committer=&lt;pattern&gt;
</term>
<listitem>
<simpara>
        Limit the commits output to ones with author/committer
        header lines that match the specified pattern (regular
        expression).  With more than one <emphasis>--author=&lt;pattern&gt;</emphasis>,
        commits whose author matches any of the given patterns are
        chosen (similarly for multiple <emphasis>--committer=&lt;pattern&gt;</emphasis>).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--grep-reflog=&lt;pattern&gt;
</term>
<listitem>
<simpara>
        Limit the commits output to ones with reflog entries that
        match the specified pattern (regular expression). With
        more than one <emphasis>--grep-reflog</emphasis>, commits whose reflog message
        matches any of the given patterns are chosen.  It is an
        error to use this option unless <emphasis>--walk-reflogs</emphasis> is in use.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--grep=&lt;pattern&gt;
</term>
<listitem>
<simpara>
        Limit the commits output to ones with a log message that
        matches the specified pattern (regular expression).  With
        more than one <emphasis>--grep=&lt;pattern&gt;</emphasis>, commits whose message
        matches any of the given patterns are chosen (but see
        <emphasis>--all-match</emphasis>).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--all-match
</term>
<listitem>
<simpara>
        Limit the commits output to ones that match all given <emphasis>--grep</emphasis>,
        instead of ones that match at least one.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--invert-grep
</term>
<listitem>
<simpara>
        Limit the commits output to ones with a log message that do not
        match the pattern specified with <emphasis>--grep=&lt;pattern&gt;</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-i
</term>
<term>
--regexp-ignore-case
</term>
<listitem>
<simpara>
        Match the regular expression limiting patterns without regard to letter
        case.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--basic-regexp
</term>
<listitem>
<simpara>
        Consider the limiting patterns to be basic regular expressions;
        this is the default.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-E
</term>
<term>
--extended-regexp
</term>
<listitem>
<simpara>
        Consider the limiting patterns to be extended regular expressions
        instead of the default basic regular expressions.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-F
</term>
<term>
--fixed-strings
</term>
<listitem>
<simpara>
        Consider the limiting patterns to be fixed strings (don't interpret
        pattern as a regular expression).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-P
</term>
<term>
--perl-regexp
</term>
<listitem>
<simpara>
        Consider the limiting patterns to be Perl-compatible regular
        expressions.
</simpara>
<simpara>Support for these types of regular expressions is an optional
compile-time dependency. If Git wasn't compiled with support for them
providing this option will cause it to die.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--remove-empty
</term>
<listitem>
<simpara>
        Stop when a given path disappears from the tree.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--merges
</term>
<listitem>
<simpara>
        Print only merge commits. This is exactly the same as <emphasis>--min-parents=2</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-merges
</term>
<listitem>
<simpara>
        Do not print commits with more than one parent. This is
        exactly the same as <emphasis>--max-parents=1</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--min-parents=&lt;number&gt;
</term>
<term>
--max-parents=&lt;number&gt;
</term>
<term>
--no-min-parents
</term>
<term>
--no-max-parents
</term>
<listitem>
<simpara>
        Show only commits which have at least (or at most) that many parent
        commits. In particular, <emphasis>--max-parents=1</emphasis> is the same as <emphasis>--no-merges</emphasis>,
        <emphasis>--min-parents=2</emphasis> is the same as <emphasis>--merges</emphasis>.  <emphasis>--max-parents=0</emphasis>
        gives all root commits and <emphasis>--min-parents=3</emphasis> all octopus merges.
</simpara>
<simpara><emphasis>--no-min-parents</emphasis> and <emphasis>--no-max-parents</emphasis> reset these limits (to no limit)
again.  Equivalent forms are <emphasis>--min-parents=0</emphasis> (any commit has 0 or more
parents) and <emphasis>--max-parents=-1</emphasis> (negative numbers denote no upper limit).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--first-parent
</term>
<listitem>
<simpara>
        When finding commits to include, follow only the first
        parent commit upon seeing a merge commit.  This option
        can give a better overview when viewing the evolution of
        a particular topic branch, because merges into a topic
        branch tend to be only about adjusting to updated upstream
        from time to time, and this option allows you to ignore
        the individual commits brought in to your history by such
        a merge.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--exclude-first-parent-only
</term>
<listitem>
<simpara>
        When finding commits to exclude (with a <emphasis>&#94;</emphasis>), follow only
        the first parent commit upon seeing a merge commit.
        This can be used to find the set of changes in a topic branch
        from the point where it diverged from the remote branch, given
        that arbitrary merges can be valid topic branch changes.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--not
</term>
<listitem>
<simpara>
        Reverses the meaning of the <emphasis>&#94;</emphasis> prefix (or lack thereof)
        for all following revision specifiers, up to the next <emphasis>--not</emphasis>.
        When used on the command line before --stdin, the revisions passed
        through stdin will not be affected by it. Conversely, when passed
        via standard input, the revisions passed on the command line will
        not be affected by it.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--all
</term>
<listitem>
<simpara>
        Pretend as if all the refs in <emphasis>refs/</emphasis>, along with <emphasis>HEAD</emphasis>, are
        listed on the command line as <emphasis>&lt;commit&gt;</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--branches[=&lt;pattern&gt;]
</term>
<listitem>
<simpara>
        Pretend as if all the refs in <emphasis>refs/heads</emphasis> are listed
        on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit
        branches to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>,
        <emphasis>&#42;</emphasis>, or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--tags[=&lt;pattern&gt;]
</term>
<listitem>
<simpara>
        Pretend as if all the refs in <emphasis>refs/tags</emphasis> are listed
        on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit
        tags to ones matching given shell glob. If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>,
        or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--remotes[=&lt;pattern&gt;]
</term>
<listitem>
<simpara>
        Pretend as if all the refs in <emphasis>refs/remotes</emphasis> are listed
        on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis> is given, limit
        remote-tracking branches to ones matching given shell glob.
        If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>, or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--glob=&lt;glob-pattern&gt;
</term>
<listitem>
<simpara>
        Pretend as if all the refs matching shell glob <emphasis>&lt;glob-pattern&gt;</emphasis>
        are listed on the command line as <emphasis>&lt;commit&gt;</emphasis>. Leading <emphasis>refs/</emphasis>,
        is automatically prepended if missing. If pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>,
        or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the end is implied.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--exclude=&lt;glob-pattern&gt;
</term>
<listitem>
<simpara>
        Do not include refs matching <emphasis>&lt;glob-pattern&gt;</emphasis> that the next <emphasis>--all</emphasis>,
        <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, <emphasis>--remotes</emphasis>, or <emphasis>--glob</emphasis> would otherwise
        consider. Repetitions of this option accumulate exclusion patterns
        up to the next <emphasis>--all</emphasis>, <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, <emphasis>--remotes</emphasis>, or
        <emphasis>--glob</emphasis> option (other options or arguments do not clear
        accumulated patterns).
</simpara>
<simpara>The patterns given should not begin with <emphasis>refs/heads</emphasis>, <emphasis>refs/tags</emphasis>, or
<emphasis>refs/remotes</emphasis> when applied to <emphasis>--branches</emphasis>, <emphasis>--tags</emphasis>, or <emphasis>--remotes</emphasis>,
respectively, and they must begin with <emphasis>refs/</emphasis> when applied to <emphasis>--glob</emphasis>
or <emphasis>--all</emphasis>. If a trailing <emphasis>/&#42;</emphasis> is intended, it must be given
explicitly.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--exclude-hidden=[fetch|receive|uploadpack]
</term>
<listitem>
<simpara>
        Do not include refs that would be hidden by <emphasis>git-fetch</emphasis>,
        <emphasis>git-receive-pack</emphasis> or <emphasis>git-upload-pack</emphasis> by consulting the appropriate
        <emphasis>fetch.hideRefs</emphasis>, <emphasis>receive.hideRefs</emphasis> or <emphasis>uploadpack.hideRefs</emphasis>
        configuration along with <emphasis>transfer.hideRefs</emphasis> (see
        <xref linkend="git-config(1)" />). This option affects the next pseudo-ref option
        <emphasis>--all</emphasis> or <emphasis>--glob</emphasis> and is cleared after processing them.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--reflog
</term>
<listitem>
<simpara>
        Pretend as if all objects mentioned by reflogs are listed on the
        command line as <emphasis>&lt;commit&gt;</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--alternate-refs
</term>
<listitem>
<simpara>
        Pretend as if all objects mentioned as ref tips of alternate
        repositories were listed on the command line. An alternate
        repository is any repository whose object directory is specified
        in <emphasis>objects/info/alternates</emphasis>.  The set of included objects may
        be modified by <emphasis>core.alternateRefsCommand</emphasis>, etc. See
        <xref linkend="git-config(1)" />.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--single-worktree
</term>
<listitem>
<simpara>
        By default, all working trees will be examined by the
        following options when there are more than one (see
        <xref linkend="git-worktree(1)" />): <emphasis>--all</emphasis>, <emphasis>--reflog</emphasis> and
        <emphasis>--indexed-objects</emphasis>.
        This option forces them to examine the current working tree
        only.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ignore-missing
</term>
<listitem>
<simpara>
        Upon seeing an invalid object name in the input, pretend as if
        the bad input was not given.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--stdin
</term>
<listitem>
<simpara>
        In addition to getting arguments from the command line, read
        them from standard input as well. This accepts commits and
        pseudo-options like <emphasis>--all</emphasis> and <emphasis>--glob=</emphasis>. When a <emphasis>--</emphasis> separator
        is seen, the following input is treated as paths and used to
        limit the result. Flags like <emphasis>--not</emphasis> which are read via standard input
        are only respected for arguments passed in the same way and will not
        influence any subsequent command line arguments.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--quiet
</term>
<listitem>
<simpara>
        Don't print anything to standard output.  This form
        is primarily meant to allow the caller to
        test the exit status to see if a range of objects is fully
        connected (or not).  It is faster than redirecting stdout
        to <emphasis>/dev/null</emphasis> as the output does not have to be formatted.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--disk-usage
</term>
<term>
--disk-usage=human
</term>
<listitem>
<simpara>
        Suppress normal output; instead, print the sum of the bytes used
        for on-disk storage by the selected commits or objects. This is
        equivalent to piping the output into <emphasis>git cat-file
        --batch-check='%(objectsize:disk)'</emphasis>, except that it runs much
        faster (especially with <emphasis>--use-bitmap-index</emphasis>). See the <emphasis>CAVEATS</emphasis>
        section in <xref linkend="git-cat-file(1)" /> for the limitations of what
        "on-disk storage" means.
        With the optional value <emphasis>human</emphasis>, on-disk storage size is shown
        in human-readable string(e.g. 12.24 Kib, 3.50 Mib).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--cherry-mark
</term>
<listitem>
<simpara>
        Like <emphasis>--cherry-pick</emphasis> (see below) but mark equivalent commits
        with <emphasis>=</emphasis> rather than omitting them, and inequivalent ones with <emphasis>+</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--cherry-pick
</term>
<listitem>
<simpara>
        Omit any commit that introduces the same change as
        another commit on the other side when the set of
        commits are limited with symmetric difference.
</simpara>
<simpara>For example, if you have two branches, <emphasis>A</emphasis> and <emphasis>B</emphasis>, a usual way
to list all commits on only one side of them is with
<emphasis>--left-right</emphasis> (see the example below in the description of
the <emphasis>--left-right</emphasis> option). However, it shows the commits that were
cherry-picked from the other branch (for example, 3rd on b may be
cherry-picked from branch A). With this option, such pairs of commits are
excluded from the output.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--left-only
</term>
<term>
--right-only
</term>
<listitem>
<simpara>
        List only commits on the respective side of a symmetric difference,
        i.e. only those which would be marked <emphasis>&lt;</emphasis> resp. <emphasis>&gt;</emphasis> by
        <emphasis>--left-right</emphasis>.
</simpara>
<simpara>For example, <emphasis>--cherry-pick --right-only A...B</emphasis> omits those
commits from <emphasis>B</emphasis> which are in <emphasis>A</emphasis> or are patch-equivalent to a commit in
<emphasis>A</emphasis>. In other words, this lists the <emphasis>+</emphasis> commits from <emphasis>git cherry A B</emphasis>.
More precisely, <emphasis>--cherry-pick --right-only --no-merges</emphasis> gives the exact
list.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--cherry
</term>
<listitem>
<simpara>
        A synonym for <emphasis>--right-only --cherry-mark --no-merges</emphasis>; useful to
        limit the output to the commits on our side and mark those that
        have been applied to the other side of a forked history with
        <emphasis>git log --cherry upstream...mybranch</emphasis>, similar to
        <emphasis>git cherry upstream mybranch</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-g
</term>
<term>
--walk-reflogs
</term>
<listitem>
<simpara>
        Instead of walking the commit ancestry chain, walk
        reflog entries from the most recent one to older ones.
        When this option is used you cannot specify commits to
        exclude (that is, <emphasis>&#94;commit</emphasis>, <emphasis>commit1..commit2</emphasis>,
        and <emphasis>commit1...commit2</emphasis> notations cannot be used).
</simpara>
<simpara>With <emphasis>--pretty</emphasis> format other than <emphasis>oneline</emphasis> and <emphasis>reference</emphasis> (for obvious reasons),
this causes the output to have two extra lines of information
taken from the reflog.  The reflog designator in the output may be shown
as <emphasis>ref@{&lt;Nth&gt;}</emphasis> (where <emphasis>&lt;Nth&gt;</emphasis> is the reverse-chronological index in the
reflog) or as <emphasis>ref@{&lt;timestamp&gt;}</emphasis> (with the <emphasis>&lt;timestamp&gt;</emphasis> for that entry),
depending on a few rules:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>
If the starting point is specified as <emphasis>ref@{&lt;Nth&gt;}</emphasis>, show the index
   format.
</simpara>
</listitem>
<listitem>
<simpara>
If the starting point was specified as <emphasis>ref@{now}</emphasis>, show the
   timestamp format.
</simpara>
</listitem>
<listitem>
<simpara>
If neither was used, but <emphasis>--date</emphasis> was given on the command line, show
   the timestamp in the format requested by <emphasis>--date</emphasis>.
</simpara>
</listitem>
<listitem>
<simpara>
Otherwise, show the index format.
</simpara>
</listitem>
</orderedlist>
<simpara>Under <emphasis>--pretty=oneline</emphasis>, the commit message is
prefixed with this information on the same line.
This option cannot be combined with <emphasis>--reverse</emphasis>.
See also <xref linkend="git-reflog(1)" />.</simpara>
<simpara>Under <emphasis>--pretty=reference</emphasis>, this information will not be shown at all.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--merge
</term>
<listitem>
<simpara>
        Show commits touching conflicted paths in the range <emphasis>HEAD...&lt;other&gt;</emphasis>,
        where <emphasis>&lt;other&gt;</emphasis> is the first existing pseudoref in <emphasis>MERGE_HEAD</emphasis>,
        <emphasis>CHERRY_PICK_HEAD</emphasis>, <emphasis>REVERT_HEAD</emphasis> or <emphasis>REBASE_HEAD</emphasis>. Only works
        when the index has unmerged entries. This option can be used to show
        relevant commits when resolving conflicts from a 3-way merge.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--boundary
</term>
<listitem>
<simpara>
        Output excluded boundary commits. Boundary commits are
        prefixed with <emphasis>-</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--use-bitmap-index
</term>
<listitem>
<simpara>
        Try to speed up the traversal using the pack bitmap index (if
        one is available). Note that when traversing with <emphasis>--objects</emphasis>,
        trees and blobs will not have their associated path printed.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--progress=&lt;header&gt;
</term>
<listitem>
<simpara>
        Show progress reports on stderr as objects are considered. The
        <emphasis>&lt;header&gt;</emphasis> text will be printed with each progress update.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="git-rev-list(1)__history_simplification">
<title>History Simplification</title>
<simpara>Sometimes you are only interested in parts of the history, for example the
commits modifying a particular &lt;path&gt;. But there are two parts of
<emphasis>History Simplification</emphasis>, one part is selecting the commits and the other
is how to do it, as there are various strategies to simplify the history.</simpara>
<simpara>The following options select the commits to be shown:</simpara>
<variablelist>
<varlistentry>
<term>
&lt;paths&gt;
</term>
<listitem>
<simpara>
        Commits modifying the given &lt;paths&gt; are selected.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--simplify-by-decoration
</term>
<listitem>
<simpara>
        Commits that are referred by some branch or tag are selected.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>Note that extra commits can be shown to give a meaningful history.</simpara>
<simpara>The following options affect the way the simplification is performed:</simpara>
<variablelist>
<varlistentry>
<term>
Default mode
</term>
<listitem>
<simpara>
        Simplifies the history to the simplest history explaining the
        final state of the tree. Simplest because it prunes some side
        branches if the end result is the same (i.e. merging branches
        with the same content)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--show-pulls
</term>
<listitem>
<simpara>
        Include all commits from the default mode, but also any merge
        commits that are not TREESAME to the first parent but are
        TREESAME to a later parent. This mode is helpful for showing
        the merge commits that "first introduced" a change to a branch.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--full-history
</term>
<listitem>
<simpara>
        Same as the default mode, but does not prune some history.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--dense
</term>
<listitem>
<simpara>
        Only the selected commits are shown, plus some to have a
        meaningful history.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--sparse
</term>
<listitem>
<simpara>
        All commits in the simplified history are shown.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--simplify-merges
</term>
<listitem>
<simpara>
        Additional option to <emphasis>--full-history</emphasis> to remove some needless
        merges from the resulting history, as there are no selected
        commits contributing to this merge.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ancestry-path[=&lt;commit&gt;]
</term>
<listitem>
<simpara>
        When given a range of commits to display (e.g. <emphasis>commit1..commit2</emphasis>
        or <emphasis>commit2 &#94;commit1</emphasis>), only display commits in that range
        that are ancestors of &lt;commit&gt;, descendants of &lt;commit&gt;, or
        &lt;commit&gt; itself.  If no commit is specified, use <emphasis>commit1</emphasis> (the
        excluded part of the range) as &lt;commit&gt;.  Can be passed multiple
        times; if so, a commit is included if it is any of the commits
        given or if it is an ancestor or descendant of one of them.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>A more detailed explanation follows.</simpara>
<simpara>Suppose you specified <emphasis>foo</emphasis> as the &lt;paths&gt;.  We shall call commits
that modify <emphasis>foo</emphasis> !TREESAME, and the rest TREESAME.  (In a diff
filtered for <emphasis>foo</emphasis>, they look different and equal, respectively.)</simpara>
<simpara>In the following, we will always refer to the same example history to
illustrate the differences between simplification settings.  We assume
that you are filtering for a file <emphasis>foo</emphasis> in this commit graph:</simpara>
<screen>          .-A---M---N---O---P---Q
         /     /   /   /   /   /
        I     B   C   D   E   Y
         \   /   /   /   /   /
          `-------------'   X</screen>
<simpara>The horizontal line of history A---Q is taken to be the first parent of
each merge.  The commits are:</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>I</emphasis> is the initial commit, in which <emphasis>foo</emphasis> exists with contents
  asdf, and a file <emphasis>quux</emphasis> exists with contents quux. Initial
  commits are compared to an empty tree, so <emphasis>I</emphasis> is !TREESAME.
</simpara>
</listitem>
<listitem>
<simpara>
In <emphasis>A</emphasis>, <emphasis>foo</emphasis> contains just foo.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>B</emphasis> contains the same change as <emphasis>A</emphasis>.  Its merge <emphasis>M</emphasis> is trivial and
  hence TREESAME to all parents.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>C</emphasis> does not change <emphasis>foo</emphasis>, but its merge <emphasis>N</emphasis> changes it to foobar,
  so it is not TREESAME to any parent.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>D</emphasis> sets <emphasis>foo</emphasis> to baz. Its merge <emphasis>O</emphasis> combines the strings from
  <emphasis>N</emphasis> and <emphasis>D</emphasis> to foobarbaz; i.e., it is not TREESAME to any parent.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>E</emphasis> changes <emphasis>quux</emphasis> to xyzzy, and its merge <emphasis>P</emphasis> combines the
  strings to quux xyzzy. <emphasis>P</emphasis> is TREESAME to <emphasis>O</emphasis>, but not to <emphasis>E</emphasis>.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>X</emphasis> is an independent root commit that added a new file <emphasis>side</emphasis>, and <emphasis>Y</emphasis>
  modified it. <emphasis>Y</emphasis> is TREESAME to <emphasis>X</emphasis>. Its merge <emphasis>Q</emphasis> added <emphasis>side</emphasis> to <emphasis>P</emphasis>, and
  <emphasis>Q</emphasis> is TREESAME to <emphasis>P</emphasis>, but not to <emphasis>Y</emphasis>.
</simpara>
</listitem>
</itemizedlist>
<simpara><emphasis>rev-list</emphasis> walks backwards through history, including or excluding
commits based on whether <emphasis>--full-history</emphasis> and/or parent rewriting
(via <emphasis>--parents</emphasis> or <emphasis>--children</emphasis>) are used. The following settings
are available.</simpara>
<variablelist>
<varlistentry>
<term>
Default mode
</term>
<listitem>
<simpara>
        Commits are included if they are not TREESAME to any parent
        (though this can be changed, see <emphasis>--sparse</emphasis> below).  If the
        commit was a merge, and it was TREESAME to one parent, follow
        only that parent.  (Even if there are several TREESAME
        parents, follow only one of them.)  Otherwise, follow all
        parents.
</simpara>
<simpara>This results in:</simpara>
<screen>          .-A---N---O
         /     /   /
        I---------D</screen>
<simpara>Note how the rule to only follow the TREESAME parent, if one is
available, removed <emphasis>B</emphasis> from consideration entirely.  <emphasis>C</emphasis> was
considered via <emphasis>N</emphasis>, but is TREESAME.  Root commits are compared to an
empty tree, so <emphasis>I</emphasis> is !TREESAME.</simpara>
<simpara>Parent/child relations are only visible with <emphasis>--parents</emphasis>, but that does
not affect the commits selected in default mode, so we have shown the
parent lines.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--full-history without parent rewriting
</term>
<listitem>
<simpara>
        This mode differs from the default in one point: always follow
        all parents of a merge, even if it is TREESAME to one of them.
        Even if more than one side of the merge has commits that are
        included, this does not imply that the merge itself is!  In
        the example, we get
</simpara>
<screen>        I  A  B  N  D  O  P  Q</screen>
<simpara><emphasis>M</emphasis> was excluded because it is TREESAME to both parents.  <emphasis>E</emphasis>,
<emphasis>C</emphasis> and <emphasis>B</emphasis> were all walked, but only <emphasis>B</emphasis> was !TREESAME, so the others
do not appear.</simpara>
<simpara>Note that without parent rewriting, it is not really possible to talk
about the parent/child relationships between the commits, so we show
them disconnected.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--full-history with parent rewriting
</term>
<listitem>
<simpara>
        Ordinary commits are only included if they are !TREESAME
        (though this can be changed, see <emphasis>--sparse</emphasis> below).
</simpara>
<simpara>Merges are always included.  However, their parent list is rewritten:
Along each parent, prune away commits that are not included
themselves.  This results in</simpara>
<screen>          .-A---M---N---O---P---Q
         /     /   /   /   /
        I     B   /   D   /
         \   /   /   /   /
          `-------------'</screen>
<simpara>Compare to <emphasis>--full-history</emphasis> without rewriting above.  Note that <emphasis>E</emphasis>
was pruned away because it is TREESAME, but the parent list of P was
rewritten to contain <emphasis>E</emphasis>'s parent <emphasis>I</emphasis>.  The same happened for <emphasis>C</emphasis> and
<emphasis>N</emphasis>, and <emphasis>X</emphasis>, <emphasis>Y</emphasis> and <emphasis>Q</emphasis>.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>In addition to the above settings, you can change whether TREESAME
affects inclusion:</simpara>
<variablelist>
<varlistentry>
<term>
--dense
</term>
<listitem>
<simpara>
        Commits that are walked are included if they are not TREESAME
        to any parent.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--sparse
</term>
<listitem>
<simpara>
        All commits that are walked are included.
</simpara>
<simpara>Note that without <emphasis>--full-history</emphasis>, this still simplifies merges: if
one of the parents is TREESAME, we follow only that one, so the other
sides of the merge are never walked.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--simplify-merges
</term>
<listitem>
<simpara>
        First, build a history graph in the same way that
        <emphasis>--full-history</emphasis> with parent rewriting does (see above).
</simpara>
<simpara>Then simplify each commit <emphasis>C</emphasis> to its replacement <emphasis>C'</emphasis> in the final
history according to the following rules:</simpara>
<itemizedlist>
<listitem>
<simpara>
Set <emphasis>C'</emphasis> to <emphasis>C</emphasis>.
</simpara>
</listitem>
<listitem>
<simpara>
Replace each parent <emphasis>P</emphasis> of <emphasis>C'</emphasis> with its simplification <emphasis>P'</emphasis>.  In
  the process, drop parents that are ancestors of other parents or that are
  root commits TREESAME to an empty tree, and remove duplicates, but take care
  to never drop all parents that we are TREESAME to.
</simpara>
</listitem>
<listitem>
<simpara>
If after this parent rewriting, <emphasis>C'</emphasis> is a root or merge commit (has
  zero or &gt;1 parents), a boundary commit, or !TREESAME, it remains.
  Otherwise, it is replaced with its only parent.
</simpara>
</listitem>
</itemizedlist>
<simpara>The effect of this is best shown by way of comparing to
<emphasis>--full-history</emphasis> with parent rewriting.  The example turns into:</simpara>
<screen>          .-A---M---N---O
         /     /       /
        I     B       D
         \   /       /
          `---------'</screen>
<simpara>Note the major differences in <emphasis>N</emphasis>, <emphasis>P</emphasis>, and <emphasis>Q</emphasis> over <emphasis>--full-history</emphasis>:</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>N</emphasis>'s parent list had <emphasis>I</emphasis> removed, because it is an ancestor of the
  other parent <emphasis>M</emphasis>.  Still, <emphasis>N</emphasis> remained because it is !TREESAME.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>P</emphasis>'s parent list similarly had <emphasis>I</emphasis> removed.  <emphasis>P</emphasis> was then
  removed completely, because it had one parent and is TREESAME.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>Q</emphasis>'s parent list had <emphasis>Y</emphasis> simplified to <emphasis>X</emphasis>. <emphasis>X</emphasis> was then removed, because it
  was a TREESAME root. <emphasis>Q</emphasis> was then removed completely, because it had one
  parent and is TREESAME.
</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
<simpara>There is another simplification mode available:</simpara>
<variablelist>
<varlistentry>
<term>
--ancestry-path[=&lt;commit&gt;]
</term>
<listitem>
<simpara>
        Limit the displayed commits to those which are an ancestor of
        &lt;commit&gt;, or which are a descendant of &lt;commit&gt;, or are &lt;commit&gt;
        itself.
</simpara>
<simpara>As an example use case, consider the following commit history:</simpara>
<screen>            D---E-------F
           /     \       \
          B---C---G---H---I---J
         /                     \
        A-------K---------------L--M</screen>
<simpara>A regular <emphasis>D..M</emphasis> computes the set of commits that are ancestors of <emphasis>M</emphasis>,
but excludes the ones that are ancestors of <emphasis>D</emphasis>. This is useful to see
what happened to the history leading to <emphasis>M</emphasis> since <emphasis>D</emphasis>, in the sense
that what does <emphasis>M</emphasis> have that did not exist in <emphasis>D</emphasis>. The result in this
example would be all the commits, except <emphasis>A</emphasis> and <emphasis>B</emphasis> (and <emphasis>D</emphasis> itself,
of course).</simpara>
<simpara>When we want to find out what commits in <emphasis>M</emphasis> are contaminated with the
bug introduced by <emphasis>D</emphasis> and need fixing, however, we might want to view
only the subset of <emphasis>D..M</emphasis> that are actually descendants of <emphasis>D</emphasis>, i.e.
excluding <emphasis>C</emphasis> and <emphasis>K</emphasis>. This is exactly what the <emphasis>--ancestry-path</emphasis>
option does. Applied to the <emphasis>D..M</emphasis> range, it results in:</simpara>
<screen>                E-------F
                 \       \
                  G---H---I---J
                               \
                                L--M</screen>
<simpara>We can also use <emphasis>--ancestry-path=D</emphasis> instead of <emphasis>--ancestry-path</emphasis> which
means the same thing when applied to the <emphasis>D..M</emphasis> range but is just more
explicit.</simpara>
<simpara>If we instead are interested in a given topic within this range, and all
commits affected by that topic, we may only want to view the subset of
<emphasis>D..M</emphasis> which contain that topic in their ancestry path.  So, using
<emphasis>--ancestry-path=H D..M</emphasis> for example would result in:</simpara>
<screen>                E
                 \
                  G---H---I---J
                               \
                                L--M</screen>
<simpara>Whereas <emphasis>--ancestry-path=K D..M</emphasis> would result in</simpara>
<screen>                K---------------L--M</screen>
</listitem>
</varlistentry>
</variablelist>
<simpara>Before discussing another option, <emphasis>--show-pulls</emphasis>, we need to
create a new example history.</simpara>
<simpara>A common problem users face when looking at simplified history is that a
commit they know changed a file somehow does not appear in the file's
simplified history. Let's demonstrate a new example and show how options
such as <emphasis>--full-history</emphasis> and <emphasis>--simplify-merges</emphasis> works in that case:</simpara>
<screen>          .-A---M-----C--N---O---P
         /     / \  \  \/   /   /
        I     B   \  R-'`-Z'   /
         \   /     \/         /
          \ /      /\        /
           `---X--'  `---Y--'</screen>
<simpara>For this example, suppose <emphasis>I</emphasis> created <emphasis>file.txt</emphasis> which was modified by
<emphasis>A</emphasis>, <emphasis>B</emphasis>, and <emphasis>X</emphasis> in different ways. The single-parent commits <emphasis>C</emphasis>, <emphasis>Z</emphasis>,
and <emphasis>Y</emphasis> do not change <emphasis>file.txt</emphasis>. The merge commit <emphasis>M</emphasis> was created by
resolving the merge conflict to include both changes from <emphasis>A</emphasis> and <emphasis>B</emphasis>
and hence is not TREESAME to either. The merge commit <emphasis>R</emphasis>, however, was
created by ignoring the contents of <emphasis>file.txt</emphasis> at <emphasis>M</emphasis> and taking only
the contents of <emphasis>file.txt</emphasis> at <emphasis>X</emphasis>. Hence, <emphasis>R</emphasis> is TREESAME to <emphasis>X</emphasis> but not
<emphasis>M</emphasis>. Finally, the natural merge resolution to create <emphasis>N</emphasis> is to take the
contents of <emphasis>file.txt</emphasis> at <emphasis>R</emphasis>, so <emphasis>N</emphasis> is TREESAME to <emphasis>R</emphasis> but not <emphasis>C</emphasis>.
The merge commits <emphasis>O</emphasis> and <emphasis>P</emphasis> are TREESAME to their first parents, but
not to their second parents, <emphasis>Z</emphasis> and <emphasis>Y</emphasis> respectively.</simpara>
<simpara>When using the default mode, <emphasis>N</emphasis> and <emphasis>R</emphasis> both have a TREESAME parent, so
those edges are walked and the others are ignored. The resulting history
graph is:</simpara>
<screen>        I---X</screen>
<simpara>When using <emphasis>--full-history</emphasis>, Git walks every edge. This will discover
the commits <emphasis>A</emphasis> and <emphasis>B</emphasis> and the merge <emphasis>M</emphasis>, but also will reveal the
merge commits <emphasis>O</emphasis> and <emphasis>P</emphasis>. With parent rewriting, the resulting graph is:</simpara>
<screen>          .-A---M--------N---O---P
         /     / \  \  \/   /   /
        I     B   \  R-'`--'   /
         \   /     \/         /
          \ /      /\        /
           `---X--'  `------'</screen>
<simpara>Here, the merge commits <emphasis>O</emphasis> and <emphasis>P</emphasis> contribute extra noise, as they did
not actually contribute a change to <emphasis>file.txt</emphasis>. They only merged a topic
that was based on an older version of <emphasis>file.txt</emphasis>. This is a common
issue in repositories using a workflow where many contributors work in
parallel and merge their topic branches along a single trunk: many
unrelated merges appear in the <emphasis>--full-history</emphasis> results.</simpara>
<simpara>When using the <emphasis>--simplify-merges</emphasis> option, the commits <emphasis>O</emphasis> and <emphasis>P</emphasis>
disappear from the results. This is because the rewritten second parents
of <emphasis>O</emphasis> and <emphasis>P</emphasis> are reachable from their first parents. Those edges are
removed and then the commits look like single-parent commits that are
TREESAME to their parent. This also happens to the commit <emphasis>N</emphasis>, resulting
in a history view as follows:</simpara>
<screen>          .-A---M--.
         /     /    \
        I     B      R
         \   /      /
          \ /      /
           `---X--'</screen>
<simpara>In this view, we see all of the important single-parent changes from
<emphasis>A</emphasis>, <emphasis>B</emphasis>, and <emphasis>X</emphasis>. We also see the carefully-resolved merge <emphasis>M</emphasis> and the
not-so-carefully-resolved merge <emphasis>R</emphasis>. This is usually enough information
to determine why the commits <emphasis>A</emphasis> and <emphasis>B</emphasis> "disappeared" from history in
the default view. However, there are a few issues with this approach.</simpara>
<simpara>The first issue is performance. Unlike any previous option, the
<emphasis>--simplify-merges</emphasis> option requires walking the entire commit history
before returning a single result. This can make the option difficult to
use for very large repositories.</simpara>
<simpara>The second issue is one of auditing. When many contributors are working
on the same repository, it is important which merge commits introduced
a change into an important branch. The problematic merge <emphasis>R</emphasis> above is
not likely to be the merge commit that was used to merge into an
important branch. Instead, the merge <emphasis>N</emphasis> was used to merge <emphasis>R</emphasis> and <emphasis>X</emphasis>
into the important branch. This commit may have information about why
the change <emphasis>X</emphasis> came to override the changes from <emphasis>A</emphasis> and <emphasis>B</emphasis> in its
commit message.</simpara>
<variablelist>
<varlistentry>
<term>
--show-pulls
</term>
<listitem>
<simpara>
        In addition to the commits shown in the default history, show
        each merge commit that is not TREESAME to its first parent but
        is TREESAME to a later parent.
</simpara>
<simpara>When a merge commit is included by <emphasis>--show-pulls</emphasis>, the merge is
treated as if it "pulled" the change from another branch. When using
<emphasis>--show-pulls</emphasis> on this example (and no other options) the resulting
graph is:</simpara>
<screen>        I---X---R---N</screen>
<simpara>Here, the merge commits <emphasis>R</emphasis> and <emphasis>N</emphasis> are included because they pulled
the commits <emphasis>X</emphasis> and <emphasis>R</emphasis> into the base branch, respectively. These
merges are the reason the commits <emphasis>A</emphasis> and <emphasis>B</emphasis> do not appear in the
default history.</simpara>
<simpara>When <emphasis>--show-pulls</emphasis> is paired with <emphasis>--simplify-merges</emphasis>, the
graph includes all of the necessary information:</simpara>
<screen>          .-A---M--.   N
         /     /    \ /
        I     B      R
         \   /      /
          \ /      /
           `---X--'</screen>
<simpara>Notice that since <emphasis>M</emphasis> is reachable from <emphasis>R</emphasis>, the edge from <emphasis>N</emphasis> to <emphasis>M</emphasis>
was simplified away. However, <emphasis>N</emphasis> still appears in the history as an
important commit because it "pulled" the change <emphasis>R</emphasis> into the main
branch.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>The <emphasis>--simplify-by-decoration</emphasis> option allows you to view only the
big picture of the topology of the history, by omitting commits
that are not referenced by tags.  Commits are marked as !TREESAME
(in other words, kept after history simplification rules described
above) if (1) they are referenced by tags, or (2) they change the
contents of the paths given on the command line.  All other
commits are marked as TREESAME (subject to be simplified away).</simpara>
</section>
<section id="git-rev-list(1)__bisection_helpers">
<title>Bisection Helpers</title>
<variablelist>
<varlistentry>
<term>
--bisect
</term>
<listitem>
<simpara>
        Limit output to the one commit object which is roughly halfway between
        included and excluded commits. Note that the bad bisection ref
        <emphasis>refs/bisect/bad</emphasis> is added to the included commits (if it
        exists) and the good bisection refs <emphasis>refs/bisect/good-*</emphasis> are
        added to the excluded commits (if they exist). Thus, supposing there
        are no refs in <emphasis>refs/bisect/</emphasis>, if
</simpara>
<screen>        $ git rev-list --bisect foo ^bar ^baz</screen>
<simpara>outputs <emphasis>midpoint</emphasis>, the output of the two commands</simpara>
<screen>        $ git rev-list foo ^midpoint
        $ git rev-list midpoint ^bar ^baz</screen>
<simpara>would be of roughly the same length.  Finding the change which
introduces a regression is thus reduced to a binary search: repeatedly
generate and test new 'midpoint's until the commit chain is of length
one.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--bisect-vars
</term>
<listitem>
<simpara>
        This calculates the same as <emphasis>--bisect</emphasis>, except that refs in
        <emphasis>refs/bisect/</emphasis> are not used, and except that this outputs
        text ready to be eval'ed by the shell. These lines will assign the
        name of the midpoint revision to the variable <emphasis>bisect_rev</emphasis>, and the
        expected number of commits to be tested after <emphasis>bisect_rev</emphasis> is tested
        to <emphasis>bisect_nr</emphasis>, the expected number of commits to be tested if
        <emphasis>bisect_rev</emphasis> turns out to be good to <emphasis>bisect_good</emphasis>, the expected
        number of commits to be tested if <emphasis>bisect_rev</emphasis> turns out to be bad to
        <emphasis>bisect_bad</emphasis>, and the number of commits we are bisecting right now to
        <emphasis>bisect_all</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--bisect-all
</term>
<listitem>
<simpara>
        This outputs all the commit objects between the included and excluded
        commits, ordered by their distance to the included and excluded
        commits. Refs in <emphasis>refs/bisect/</emphasis> are not used. The farthest
        from them is displayed first. (This is the only one displayed by
        <emphasis>--bisect</emphasis>.)
</simpara>
<simpara>This is useful because it makes it easy to choose a good commit to
test when you want to avoid to test some of them for some reason (they
may not compile for example).</simpara>
<simpara>This option can be used along with <emphasis>--bisect-vars</emphasis>, in this case,
after all the sorted commit objects, there will be the same text as if
<emphasis>--bisect-vars</emphasis> had been used alone.</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="git-rev-list(1)__commit_ordering">
<title>Commit Ordering</title>
<simpara>By default, the commits are shown in reverse chronological order.</simpara>
<variablelist>
<varlistentry>
<term>
--date-order
</term>
<listitem>
<simpara>
        Show no parents before all of its children are shown, but
        otherwise show commits in the commit timestamp order.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--author-date-order
</term>
<listitem>
<simpara>
        Show no parents before all of its children are shown, but
        otherwise show commits in the author timestamp order.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--topo-order
</term>
<listitem>
<simpara>
        Show no parents before all of its children are shown, and
        avoid showing commits on multiple lines of history
        intermixed.
</simpara>
<simpara>For example, in a commit history like this:</simpara>
<screen>    ---1----2----4----7
        \              \
         3----5----6----8---</screen>
<simpara>where the numbers denote the order of commit timestamps, <emphasis>git
rev-list</emphasis> and friends with <emphasis>--date-order</emphasis> show the commits in the
timestamp order: 8 7 6 5 4 3 2 1.</simpara>
<simpara>With <emphasis>--topo-order</emphasis>, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5
3 1); some older commits are shown before newer ones in order to
avoid showing the commits from two parallel development track mixed
together.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--reverse
</term>
<listitem>
<simpara>
        Output the commits chosen to be shown (see Commit Limiting
        section above) in reverse order. Cannot be combined with
        <emphasis>--walk-reflogs</emphasis>.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="git-rev-list(1)__object_traversal">
<title>Object Traversal</title>
<simpara>These options are mostly targeted for packing of Git repositories.</simpara>
<variablelist>
<varlistentry>
<term>
--objects
</term>
<listitem>
<simpara>
        Print the object IDs of any object referenced by the listed
        commits.  <emphasis>--objects foo ^bar</emphasis> thus means send me
        all object IDs which I need to download if I have the commit
        object <emphasis>bar</emphasis> but not <emphasis>foo</emphasis>. See also <emphasis>--object-names</emphasis> below.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--in-commit-order
</term>
<listitem>
<simpara>
        Print tree and blob ids in order of the commits. The tree
        and blob ids are printed after they are first referenced
        by a commit.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--objects-edge
</term>
<listitem>
<simpara>
        Similar to <emphasis>--objects</emphasis>, but also print the IDs of excluded
        commits prefixed with a - character.  This is used by
        <xref linkend="git-pack-objects(1)" /> to build a thin pack, which records
        objects in deltified form based on objects contained in these
        excluded commits to reduce network traffic.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--objects-edge-aggressive
</term>
<listitem>
<simpara>
        Similar to <emphasis>--objects-edge</emphasis>, but it tries harder to find excluded
        commits at the cost of increased time.  This is used instead of
        <emphasis>--objects-edge</emphasis> to build thin packs for shallow repositories.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--indexed-objects
</term>
<listitem>
<simpara>
        Pretend as if all trees and blobs used by the index are listed
        on the command line.  Note that you probably want to use
        <emphasis>--objects</emphasis>, too.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--unpacked
</term>
<listitem>
<simpara>
        Only useful with <emphasis>--objects</emphasis>; print the object IDs that are not
        in packs.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--object-names
</term>
<listitem>
<simpara>
        Only useful with <emphasis>--objects</emphasis>; print the names of the object IDs
        that are found. This is the default behavior. Note that the
        "name" of each object is ambiguous, and mostly intended as a
        hint for packing objects. In particular: no distinction is made between
        the names of tags, trees, and blobs; path names may be modified
        to remove newlines; and if an object would appear multiple times
        with different names, only one name is shown.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-object-names
</term>
<listitem>
<simpara>
        Only useful with <emphasis>--objects</emphasis>; does not print the names of the object
        IDs that are found. This inverts <emphasis>--object-names</emphasis>. This flag allows
        the output to be more easily parsed by commands such as
        <xref linkend="git-cat-file(1)" />.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--filter=&lt;filter-spec&gt;
</term>
<listitem>
<simpara>
        Only useful with one of the <emphasis>--objects*</emphasis>; omits objects (usually
        blobs) from the list of printed objects.  The <emphasis>&lt;filter-spec&gt;</emphasis>
        may be one of the following:
</simpara>
<simpara>The form <emphasis>--filter=blob:none</emphasis> omits all blobs.</simpara>
<simpara>The form <emphasis>--filter=blob:limit=&lt;n&gt;[kmg]</emphasis> omits blobs of size at least n
bytes or units.  n may be zero.  The suffixes k, m, and g can be used
to name units in KiB, MiB, or GiB.  For example, <emphasis>blob:limit=1k</emphasis>
is the same as <emphasis>blob:limit=1024</emphasis>.</simpara>
<simpara>The form <emphasis>--filter=object:type=(tag|commit|tree|blob)</emphasis> omits all objects
which are not of the requested type.</simpara>
<simpara>The form <emphasis>--filter=sparse:oid=&lt;blob-ish&gt;</emphasis> uses a sparse-checkout
specification contained in the blob (or blob-expression) <emphasis>&lt;blob-ish&gt;</emphasis>
to omit blobs that would not be required for a sparse checkout on
the requested refs.</simpara>
<simpara>The form <emphasis>--filter=tree:&lt;depth&gt;</emphasis> omits all blobs and trees whose depth
from the root tree is &gt;= &lt;depth&gt; (minimum depth if an object is located
at multiple depths in the commits traversed). &lt;depth&gt;=0 will not include
any trees or blobs unless included explicitly in the command-line (or
standard input when --stdin is used). &lt;depth&gt;=1 will include only the
tree and blobs which are referenced directly by a commit reachable from
&lt;commit&gt; or an explicitly-given object. &lt;depth&gt;=2 is like &lt;depth&gt;=1
while also including trees and blobs one more level removed from an
explicitly-given commit or tree.</simpara>
<simpara>Note that the form <emphasis>--filter=sparse:path=&lt;path&gt;</emphasis> that wants to read
from an arbitrary path on the filesystem has been dropped for security
reasons.</simpara>
<simpara>Multiple <emphasis>--filter=</emphasis> flags can be specified to combine filters. Only
objects which are accepted by every filter are included.</simpara>
<simpara>The form <emphasis>--filter=combine:&lt;filter1&gt;+&lt;filter2&gt;+&#8230;&lt;filterN&gt;</emphasis> can also be
used to combined several filters, but this is harder than just repeating
the <emphasis>--filter</emphasis> flag and is usually not necessary. Filters are joined by
<emphasis>&#43;</emphasis> and individual filters are %-encoded (i.e. URL-encoded).
Besides the <emphasis>&#43;</emphasis> and <emphasis>%</emphasis> characters, the following characters are
reserved and also must be encoded: <emphasis>~!@#$^&amp;*()[]{}\;",&lt;&gt;?</emphasis><literal>&#39;&#96;</literal>
as well as all characters with ASCII code &lt;= <emphasis>0x20</emphasis>, which includes
space and newline.</simpara>
<simpara>Other arbitrary characters can also be encoded. For instance,
<emphasis>combine:tree:3+blob:none</emphasis> and <emphasis>combine:tree%3A3+blob%3Anone</emphasis> are
equivalent.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-filter
</term>
<listitem>
<simpara>
        Turn off any previous <emphasis>--filter=</emphasis> argument.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--filter-provided-objects
</term>
<listitem>
<simpara>
        Filter the list of explicitly provided objects, which would otherwise
        always be printed even if they did not match any of the filters. Only
        useful with <emphasis>--filter=</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--filter-print-omitted
</term>
<listitem>
<simpara>
        Only useful with <emphasis>--filter=</emphasis>; prints a list of the objects omitted
        by the filter.  Object IDs are prefixed with a ~ character.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--missing=&lt;missing-action&gt;
</term>
<listitem>
<simpara>
        A debug option to help with future "partial clone" development.
        This option specifies how missing objects are handled.
</simpara>
<simpara>The form <emphasis>--missing=error</emphasis> requests that rev-list stop with an error if
a missing object is encountered.  This is the default action.</simpara>
<simpara>The form <emphasis>--missing=allow-any</emphasis> will allow object traversal to continue
if a missing object is encountered.  Missing objects will silently be
omitted from the results.</simpara>
<simpara>The form <emphasis>--missing=allow-promisor</emphasis> is like <emphasis>allow-any</emphasis>, but will only
allow object traversal to continue for EXPECTED promisor missing objects.
Unexpected missing objects will raise an error.</simpara>
<simpara>The form <emphasis>--missing=print</emphasis> is like <emphasis>allow-any</emphasis>, but will also print a
list of the missing objects.  Object IDs are prefixed with a ? character.</simpara>
<simpara>If some tips passed to the traversal are missing, they will be
considered as missing too, and the traversal will ignore them. In case
we cannot get their Object ID though, an error will be raised.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--exclude-promisor-objects
</term>
<listitem>
<simpara>
        (For internal use only.)  Prefilter object traversal at
        promisor boundary.  This is used with partial clone.  This is
        stronger than <emphasis>--missing=allow-promisor</emphasis> because it limits the
        traversal, rather than just silencing errors about missing
        objects.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-walk[=(sorted|unsorted)]
</term>
<listitem>
<simpara>
        Only show the given commits, but do not traverse their ancestors.
        This has no effect if a range is specified. If the argument
        <emphasis>unsorted</emphasis> is given, the commits are shown in the order they were
        given on the command line. Otherwise (if <emphasis>sorted</emphasis> or no argument
        was given), the commits are shown in reverse chronological order
        by commit time.
        Cannot be combined with <emphasis>--graph</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--do-walk
</term>
<listitem>
<simpara>
        Overrides a previous <emphasis>--no-walk</emphasis>.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="git-rev-list(1)__commit_formatting">
<title>Commit Formatting</title>
<simpara>Using these options, <xref linkend="git-rev-list(1)" /> will act similar to the
more specialized family of commit log tools: <xref linkend="git-log(1)" />,
<xref linkend="git-show(1)" />, and <xref linkend="git-whatchanged(1)" /></simpara>
<variablelist>
<varlistentry>
<term>
--pretty[=&lt;format&gt;]
</term>
<term>
--format=&lt;format&gt;
</term>
<listitem>
<simpara>
        Pretty-print the contents of the commit logs in a given format,
        where <emphasis>&lt;format&gt;</emphasis> can be one of <emphasis>oneline</emphasis>, <emphasis>short</emphasis>, <emphasis>medium</emphasis>,
        <emphasis>full</emphasis>, <emphasis>fuller</emphasis>, <emphasis>reference</emphasis>, <emphasis>email</emphasis>, <emphasis>raw</emphasis>, <emphasis>format:&lt;string&gt;</emphasis>
        and <emphasis>tformat:&lt;string&gt;</emphasis>.  When <emphasis>&lt;format&gt;</emphasis> is none of the above,
        and has <emphasis>%placeholder</emphasis> in it, it acts as if
        <emphasis>--pretty=tformat:&lt;format&gt;</emphasis> were given.
</simpara>
<simpara>See the "PRETTY FORMATS" section for some additional details for each
format.  When <emphasis>=&lt;format&gt;</emphasis> part is omitted, it defaults to <emphasis>medium</emphasis>.</simpara>
<simpara>Note: you can specify the default pretty format in the repository
configuration (see <xref linkend="git-config(1)" />).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--abbrev-commit
</term>
<listitem>
<simpara>
        Instead of showing the full 40-byte hexadecimal commit object
        name, show a prefix that names the object uniquely.
        "--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
        option can be used to specify the minimum length of the prefix.
</simpara>
<simpara>This should make "--pretty=oneline" a whole lot more readable for
people using 80-column terminals.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-abbrev-commit
</term>
<listitem>
<simpara>
        Show the full 40-byte hexadecimal commit object name. This negates
        <emphasis>--abbrev-commit</emphasis>, either explicit or implied by other options such
        as "--oneline". It also overrides the <emphasis>log.abbrevCommit</emphasis> variable.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--oneline
</term>
<listitem>
<simpara>
        This is a shorthand for "--pretty=oneline --abbrev-commit"
        used together.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--encoding=&lt;encoding&gt;
</term>
<listitem>
<simpara>
        Commit objects record the character encoding used for the log message
        in their encoding header; this option can be used to tell the
        command to re-code the commit log message in the encoding
        preferred by the user.  For non plumbing commands this
        defaults to UTF-8. Note that if an object claims to be encoded
        in <emphasis>X</emphasis> and we are outputting in <emphasis>X</emphasis>, we will output the object
        verbatim; this means that invalid sequences in the original
        commit may be copied to the output. Likewise, if iconv(3) fails
        to convert the commit, we will quietly output the original
        object verbatim.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--expand-tabs=&lt;n&gt;
</term>
<term>
--expand-tabs
</term>
<term>
--no-expand-tabs
</term>
<listitem>
<simpara>
        Perform a tab expansion (replace each tab with enough spaces
        to fill to the next display column that is a multiple of <emphasis>&lt;n&gt;</emphasis>)
        in the log message before showing it in the output.
        <emphasis>--expand-tabs</emphasis> is a short-hand for <emphasis>--expand-tabs=8</emphasis>, and
        <emphasis>--no-expand-tabs</emphasis> is a short-hand for <emphasis>--expand-tabs=0</emphasis>,
        which disables tab expansion.
</simpara>
<simpara>By default, tabs are expanded in pretty formats that indent the log
message by 4 spaces (i.e.  <emphasis>medium</emphasis>, which is the default, <emphasis>full</emphasis>,
and <emphasis>fuller</emphasis>).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--show-signature
</term>
<listitem>
<simpara>
        Check the validity of a signed commit object by passing the signature
        to <emphasis>gpg --verify</emphasis> and show the output.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--relative-date
</term>
<listitem>
<simpara>
        Synonym for <emphasis>--date=relative</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--date=&lt;format&gt;
</term>
<listitem>
<simpara>
        Only takes effect for dates shown in human-readable format, such
        as when using <emphasis>--pretty</emphasis>. <emphasis>log.date</emphasis> config variable sets a default
        value for the log command's <emphasis>--date</emphasis> option. By default, dates
        are shown in the original time zone (either committer's or
        author's). If <emphasis>-local</emphasis> is appended to the format (e.g.,
        <emphasis>iso-local</emphasis>), the user's local time zone is used instead.
</simpara>
<simpara><emphasis>--date=relative</emphasis> shows dates relative to the current time,
e.g. 2 hours ago. The <emphasis>-local</emphasis> option has no effect for
<emphasis>--date=relative</emphasis>.</simpara>
<simpara><emphasis>--date=local</emphasis> is an alias for <emphasis>--date=default-local</emphasis>.</simpara>
<simpara><emphasis>--date=iso</emphasis> (or <emphasis>--date=iso8601</emphasis>) shows timestamps in a ISO 8601-like format.
The differences to the strict ISO 8601 format are:</simpara>
<itemizedlist>
<listitem>
<simpara>
a space instead of the <emphasis>T</emphasis> date/time delimiter
</simpara>
</listitem>
<listitem>
<simpara>
a space between time and time zone
</simpara>
</listitem>
<listitem>
<simpara>
no colon between hours and minutes of the time zone
</simpara>
</listitem>
</itemizedlist>
<simpara><emphasis>--date=iso-strict</emphasis> (or <emphasis>--date=iso8601-strict</emphasis>) shows timestamps in strict
ISO 8601 format.</simpara>
<simpara><emphasis>--date=rfc</emphasis> (or <emphasis>--date=rfc2822</emphasis>) shows timestamps in RFC 2822
format, often found in email messages.</simpara>
<simpara><emphasis>--date=short</emphasis> shows only the date, but not the time, in <emphasis>YYYY-MM-DD</emphasis> format.</simpara>
<simpara><emphasis>--date=raw</emphasis> shows the date as seconds since the epoch (1970-01-01
00:00:00 UTC), followed by a space, and then the timezone as an offset
from UTC (a <emphasis>+</emphasis> or <emphasis>-</emphasis> with four digits; the first two are hours, and
the second two are minutes). I.e., as if the timestamp were formatted
with <emphasis>strftime("%s %z")</emphasis>).
Note that the <emphasis>-local</emphasis> option does not affect the seconds-since-epoch
value (which is always measured in UTC), but does switch the accompanying
timezone value.</simpara>
<simpara><emphasis>--date=human</emphasis> shows the timezone if the timezone does not match the
current time-zone, and doesn't print the whole date if that matches
(ie skip printing year for dates that are "this year", but also skip
the whole date itself if it's in the last few days and we can just say
what weekday it was).  For older dates the hour and minute is also
omitted.</simpara>
<simpara><emphasis>--date=unix</emphasis> shows the date as a Unix epoch timestamp (seconds since
1970).  As with <emphasis>--raw</emphasis>, this is always in UTC and therefore <emphasis>-local</emphasis>
has no effect.</simpara>
<simpara><emphasis>--date=format:...</emphasis> feeds the format <emphasis>...</emphasis> to your system <emphasis>strftime</emphasis>,
except for %s, %z, and %Z, which are handled internally.
Use <emphasis>--date=format:%c</emphasis> to show the date in your system locale's
preferred format.  See the <emphasis>strftime</emphasis> manual for a complete list of
format placeholders. When using <emphasis>-local</emphasis>, the correct syntax is
<emphasis>--date=format-local:...</emphasis>.</simpara>
<simpara><emphasis>--date=default</emphasis> is the default format, and is based on ctime(3)
output.  It shows a single line with three-letter day of the week,
three-letter month, day-of-month, hour-minute-seconds in "HH:MM:SS"
format, followed by 4-digit year, plus timezone information, unless
the local time zone is used, e.g. <emphasis>Thu Jan 1 00:00:00 1970 +0000</emphasis>.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--header
</term>
<listitem>
<simpara>
        Print the contents of the commit in raw-format; each record is
        separated with a NUL character.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-commit-header
</term>
<listitem>
<simpara>
        Suppress the header line containing "commit" and the object ID printed before
        the specified format.  This has no effect on the built-in formats; only custom
        formats are affected.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--commit-header
</term>
<listitem>
<simpara>
        Overrides a previous <emphasis>--no-commit-header</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--parents
</term>
<listitem>
<simpara>
        Print also the parents of the commit (in the form "commit parent&#8230;").
        Also enables parent rewriting, see <emphasis>History Simplification</emphasis> above.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--children
</term>
<listitem>
<simpara>
        Print also the children of the commit (in the form "commit child&#8230;").
        Also enables parent rewriting, see <emphasis>History Simplification</emphasis> above.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--timestamp
</term>
<listitem>
<simpara>
        Print the raw commit timestamp.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--left-right
</term>
<listitem>
<simpara>
        Mark which side of a symmetric difference a commit is reachable from.
        Commits from the left side are prefixed with <emphasis>&lt;</emphasis> and those from
        the right with <emphasis>&gt;</emphasis>.  If combined with <emphasis>--boundary</emphasis>, those
        commits are prefixed with <emphasis>-</emphasis>.
</simpara>
<simpara>For example, if you have this topology:</simpara>
<screen>             y---b---b  branch B
            / \ /
           /   .
          /   / \
         o---x---a---a  branch A</screen>
<simpara>you would get an output like this:</simpara>
<screen>        $ git rev-list --left-right --boundary --pretty=oneline A...B

        &gt;bbbbbbb... 3rd on b
        &gt;bbbbbbb... 2nd on b
        &lt;aaaaaaa... 3rd on a
        &lt;aaaaaaa... 2nd on a
        -yyyyyyy... 1st on b
        -xxxxxxx... 1st on a</screen>
</listitem>
</varlistentry>
<varlistentry>
<term>
--graph
</term>
<listitem>
<simpara>
        Draw a text-based graphical representation of the commit history
        on the left hand side of the output.  This may cause extra lines
        to be printed in between commits, in order for the graph history
        to be drawn properly.
        Cannot be combined with <emphasis>--no-walk</emphasis>.
</simpara>
<simpara>This enables parent rewriting, see <emphasis>History Simplification</emphasis> above.</simpara>
<simpara>This implies the <emphasis>--topo-order</emphasis> option by default, but the
<emphasis>--date-order</emphasis> option may also be specified.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--show-linear-break[=&lt;barrier&gt;]
</term>
<listitem>
<simpara>
        When --graph is not used, all history branches are flattened
        which can make it hard to see that the two consecutive commits
        do not belong to a linear branch. This option puts a barrier
        in between them in that case. If <emphasis>&lt;barrier&gt;</emphasis> is specified, it
        is the string that will be shown instead of the default one.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--count
</term>
<listitem>
<simpara>
        Print a number stating how many commits would have been
        listed, and suppress all other output.  When used together
        with <emphasis>--left-right</emphasis>, instead print the counts for left and
        right commits, separated by a tab. When used together with
        <emphasis>--cherry-mark</emphasis>, omit patch equivalent commits from these
        counts and print the count for equivalent commits separated
        by a tab.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
</simplesect>
<simplesect id="git-rev-list(1)__pretty_formats">
<title>PRETTY FORMATS</title>
<simpara>If the commit is a merge, and if the pretty-format
is not <emphasis>oneline</emphasis>, <emphasis>email</emphasis> or <emphasis>raw</emphasis>, an additional line is
inserted before the <emphasis>Author:</emphasis> line.  This line begins with
"Merge: " and the hashes of ancestral commits are printed,
separated by spaces.  Note that the listed commits may not
necessarily be the list of the <emphasis role="strong">direct</emphasis> parent commits if you
have limited your view of history: for example, if you are
only interested in changes related to a certain directory or
file.</simpara>
<simpara>There are several built-in formats, and you can define
additional formats by setting a pretty.&lt;name&gt;
config option to either another format name, or a
<emphasis>format:</emphasis> string, as described below (see
<xref linkend="git-config(1)" />). Here are the details of the
built-in formats:</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>oneline</emphasis>
</simpara>
<literallayout class="monospaced">&lt;hash&gt; &lt;title-line&gt;</literallayout>
<simpara>This is designed to be as compact as possible.</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>short</emphasis>
</simpara>
<literallayout class="monospaced">commit &lt;hash&gt;
Author: &lt;author&gt;</literallayout>
<literallayout class="monospaced">&lt;title-line&gt;</literallayout>
</listitem>
<listitem>
<simpara>
<emphasis>medium</emphasis>
</simpara>
<literallayout class="monospaced">commit &lt;hash&gt;
Author: &lt;author&gt;
Date:   &lt;author-date&gt;</literallayout>
<literallayout class="monospaced">&lt;title-line&gt;</literallayout>
<literallayout class="monospaced">&lt;full-commit-message&gt;</literallayout>
</listitem>
<listitem>
<simpara>
<emphasis>full</emphasis>
</simpara>
<literallayout class="monospaced">commit &lt;hash&gt;
Author: &lt;author&gt;
Commit: &lt;committer&gt;</literallayout>
<literallayout class="monospaced">&lt;title-line&gt;</literallayout>
<literallayout class="monospaced">&lt;full-commit-message&gt;</literallayout>
</listitem>
<listitem>
<simpara>
<emphasis>fuller</emphasis>
</simpara>
<literallayout class="monospaced">commit &lt;hash&gt;
Author:     &lt;author&gt;
AuthorDate: &lt;author-date&gt;
Commit:     &lt;committer&gt;
CommitDate: &lt;committer-date&gt;</literallayout>
<literallayout class="monospaced">&lt;title-line&gt;</literallayout>
<literallayout class="monospaced">&lt;full-commit-message&gt;</literallayout>
</listitem>
<listitem>
<simpara>
<emphasis>reference</emphasis>
</simpara>
<literallayout class="monospaced">&lt;abbrev-hash&gt; (&lt;title-line&gt;, &lt;short-author-date&gt;)</literallayout>
<simpara>This format is used to refer to another commit in a commit message and
is the same as <emphasis>--pretty='format:%C(auto)%h (%s, %ad)'</emphasis>.  By default,
the date is formatted with <emphasis>--date=short</emphasis> unless another <emphasis>--date</emphasis> option
is explicitly specified.  As with any <emphasis>format:</emphasis> with format
placeholders, its output is not affected by other options like
<emphasis>--decorate</emphasis> and <emphasis>--walk-reflogs</emphasis>.</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>email</emphasis>
</simpara>
<literallayout class="monospaced">From &lt;hash&gt; &lt;date&gt;
From: &lt;author&gt;
Date: &lt;author-date&gt;
Subject: [PATCH] &lt;title-line&gt;</literallayout>
<literallayout class="monospaced">&lt;full-commit-message&gt;</literallayout>
</listitem>
<listitem>
<simpara>
<emphasis>mboxrd</emphasis>
</simpara>
<simpara>Like <emphasis>email</emphasis>, but lines in the commit message starting with "From "
(preceded by zero or more "&gt;") are quoted with "&gt;" so they aren't
confused as starting a new commit.</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>raw</emphasis>
</simpara>
<simpara>The <emphasis>raw</emphasis> format shows the entire commit exactly as
stored in the commit object.  Notably, the hashes are
displayed in full, regardless of whether --abbrev or
--no-abbrev are used, and <emphasis>parents</emphasis> information show the
true parent commits, without taking grafts or history
simplification into account. Note that this format affects the way
commits are displayed, but not the way the diff is shown e.g. with
<emphasis>git log --raw</emphasis>. To get full object names in a raw diff format,
use <emphasis>--no-abbrev</emphasis>.</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>format:&lt;format-string&gt;</emphasis>
</simpara>
<simpara>The <emphasis>format:&lt;format-string&gt;</emphasis> format allows you to specify which information
you want to show. It works a little bit like printf format,
with the notable exception that you get a newline with <emphasis>%n</emphasis>
instead of <emphasis>\n</emphasis>.</simpara>
<simpara>E.g, <emphasis>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</emphasis>
would show something like this:</simpara>
<screen>The author of fe6e0ee was Junio C Hamano, 23 hours ago
The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</screen>
<simpara>The placeholders are:</simpara>
<itemizedlist>
<listitem>
<simpara>
Placeholders that expand to a single literal character:
</simpara>
<variablelist>
<varlistentry>
<term>
<emphasis>%n</emphasis>
</term>
<listitem>
<simpara>
newline
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%%</emphasis>
</term>
<listitem>
<simpara>
a raw <emphasis>%</emphasis>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%x00</emphasis>
</term>
<listitem>
<simpara>
<emphasis>%x</emphasis> followed by two hexadecimal digits is replaced with a
         byte with the hexadecimal digits' value (we will call this
         "literal formatting code" in the rest of this document).
</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
<listitem>
<simpara>
Placeholders that affect formatting of later placeholders:
</simpara>
<variablelist>
<varlistentry>
<term>
<emphasis>%Cred</emphasis>
</term>
<listitem>
<simpara>
switch color to red
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%Cgreen</emphasis>
</term>
<listitem>
<simpara>
switch color to green
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%Cblue</emphasis>
</term>
<listitem>
<simpara>
switch color to blue
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%Creset</emphasis>
</term>
<listitem>
<simpara>
reset color
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%C(&#8230;)</emphasis>
</term>
<listitem>
<simpara>
color specification, as described under Values in the
            "CONFIGURATION FILE" section of <xref linkend="git-config(1)" />.  By
            default, colors are shown only when enabled for log output
            (by <emphasis>color.diff</emphasis>, <emphasis>color.ui</emphasis>, or <emphasis>--color</emphasis>, and respecting
            the <emphasis>auto</emphasis> settings of the former if we are going to a
            terminal). <emphasis>%C(auto,...)</emphasis> is accepted as a historical
            synonym for the default (e.g., <emphasis>%C(auto,red)</emphasis>). Specifying
            <emphasis>%C(always,...)</emphasis> will show the colors even when color is
            not otherwise enabled (though consider just using
            <emphasis>--color=always</emphasis> to enable color for the whole output,
            including this format and anything else git might color).
            <emphasis>auto</emphasis> alone (i.e. <emphasis>%C(auto)</emphasis>) will turn on auto coloring
            on the next placeholders until the color is switched
            again.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%m</emphasis>
</term>
<listitem>
<simpara>
left (<emphasis>&lt;</emphasis>), right (<emphasis>&gt;</emphasis>) or boundary (<emphasis>-</emphasis>) mark
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</emphasis>
</term>
<listitem>
<simpara>
switch line wrapping, like the -w option of
                            <xref linkend="git-shortlog(1)" />.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%&lt;( &lt;N&gt; [,trunc|ltrunc|mtrunc])</emphasis>
</term>
<listitem>
<simpara>
make the next placeholder take at
                                  least N column widths, padding spaces on
                                  the right if necessary.  Optionally
                                  truncate (with ellipsis <emphasis>..</emphasis>) at the left (ltrunc) <emphasis>..ft</emphasis>,
                                  the middle (mtrunc) <emphasis>mi..le</emphasis>, or the end
                                  (trunc) <emphasis>rig..</emphasis>, if the output is longer than
                                  N columns.
                                  Note 1: that truncating
                                  only works correctly with N &gt;= 2.
                                  Note 2: spaces around the N and M (see below)
                                  values are optional.
                                  Note 3: Emojis and other wide characters
                                  will take two display columns, which may
                                  over-run column boundaries.
                                  Note 4: decomposed character combining marks
                                  may be misplaced at padding boundaries.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%&lt;|( &lt;M&gt; )</emphasis>
</term>
<listitem>
<simpara>
make the next placeholder take at least until Mth
             display column, padding spaces on the right if necessary.
             Use negative M values for column positions measured
             from the right hand edge of the terminal window.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%&gt;( &lt;N&gt; )</emphasis>, <emphasis>%&gt;|( &lt;M&gt; )</emphasis>
</term>
<listitem>
<simpara>
similar to <emphasis>%&lt;( &lt;N&gt; )</emphasis>, <emphasis>%&lt;|( &lt;M&gt; )</emphasis> respectively,
                        but padding spaces on the left
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%&gt;&gt;( &lt;N&gt; )</emphasis>, <emphasis>%&gt;&gt;|( &lt;M&gt; )</emphasis>
</term>
<listitem>
<simpara>
similar to <emphasis>%&gt;( &lt;N&gt; )</emphasis>, <emphasis>%&gt;|( &lt;M&gt; )</emphasis>
                          respectively, except that if the next
                          placeholder takes more spaces than given and
                          there are spaces on its left, use those
                          spaces
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%&gt;&lt;( &lt;N&gt; )</emphasis>, <emphasis>%&gt;&lt;|( &lt;M&gt; )</emphasis>
</term>
<listitem>
<simpara>
similar to <emphasis>%&lt;( &lt;N&gt; )</emphasis>, <emphasis>%&lt;|( &lt;M&gt; )</emphasis>
                          respectively, but padding both sides
                          (i.e. the text is centered)
</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
<listitem>
<simpara>
Placeholders that expand to information extracted from the commit:
</simpara>
<variablelist>
<varlistentry>
<term>
<emphasis>%H</emphasis>
</term>
<listitem>
<simpara>
commit hash
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%h</emphasis>
</term>
<listitem>
<simpara>
abbreviated commit hash
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%T</emphasis>
</term>
<listitem>
<simpara>
tree hash
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%t</emphasis>
</term>
<listitem>
<simpara>
abbreviated tree hash
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%P</emphasis>
</term>
<listitem>
<simpara>
parent hashes
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%p</emphasis>
</term>
<listitem>
<simpara>
abbreviated parent hashes
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%an</emphasis>
</term>
<listitem>
<simpara>
author name
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%aN</emphasis>
</term>
<listitem>
<simpara>
author name (respecting .mailmap, see <xref linkend="git-shortlog(1)" />
        or <xref linkend="git-blame(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ae</emphasis>
</term>
<listitem>
<simpara>
author email
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%aE</emphasis>
</term>
<listitem>
<simpara>
author email (respecting .mailmap, see <xref linkend="git-shortlog(1)" />
        or <xref linkend="git-blame(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%al</emphasis>
</term>
<listitem>
<simpara>
author email local-part (the part before the <emphasis>@</emphasis> sign)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%aL</emphasis>
</term>
<listitem>
<simpara>
author local-part (see <emphasis>%al</emphasis>) respecting .mailmap, see
        <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ad</emphasis>
</term>
<listitem>
<simpara>
author date (format respects --date= option)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%aD</emphasis>
</term>
<listitem>
<simpara>
author date, RFC2822 style
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ar</emphasis>
</term>
<listitem>
<simpara>
author date, relative
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%at</emphasis>
</term>
<listitem>
<simpara>
author date, UNIX timestamp
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ai</emphasis>
</term>
<listitem>
<simpara>
author date, ISO 8601-like format
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%aI</emphasis>
</term>
<listitem>
<simpara>
author date, strict ISO 8601 format
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%as</emphasis>
</term>
<listitem>
<simpara>
author date, short format (<emphasis>YYYY-MM-DD</emphasis>)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ah</emphasis>
</term>
<listitem>
<simpara>
author date, human style (like the <emphasis>--date=human</emphasis> option of
        <xref linkend="git-rev-list(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cn</emphasis>
</term>
<listitem>
<simpara>
committer name
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cN</emphasis>
</term>
<listitem>
<simpara>
committer name (respecting .mailmap, see
        <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ce</emphasis>
</term>
<listitem>
<simpara>
committer email
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cE</emphasis>
</term>
<listitem>
<simpara>
committer email (respecting .mailmap, see
        <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cl</emphasis>
</term>
<listitem>
<simpara>
committer email local-part (the part before the <emphasis>@</emphasis> sign)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cL</emphasis>
</term>
<listitem>
<simpara>
committer local-part (see <emphasis>%cl</emphasis>) respecting .mailmap, see
        <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cd</emphasis>
</term>
<listitem>
<simpara>
committer date (format respects --date= option)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cD</emphasis>
</term>
<listitem>
<simpara>
committer date, RFC2822 style
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cr</emphasis>
</term>
<listitem>
<simpara>
committer date, relative
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ct</emphasis>
</term>
<listitem>
<simpara>
committer date, UNIX timestamp
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ci</emphasis>
</term>
<listitem>
<simpara>
committer date, ISO 8601-like format
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cI</emphasis>
</term>
<listitem>
<simpara>
committer date, strict ISO 8601 format
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%cs</emphasis>
</term>
<listitem>
<simpara>
committer date, short format (<emphasis>YYYY-MM-DD</emphasis>)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ch</emphasis>
</term>
<listitem>
<simpara>
committer date, human style (like the <emphasis>--date=human</emphasis> option of
        <xref linkend="git-rev-list(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%d</emphasis>
</term>
<listitem>
<simpara>
ref names, like the --decorate option of <xref linkend="git-log(1)" />
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%D</emphasis>
</term>
<listitem>
<simpara>
ref names without the " (", ")" wrapping.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%(decorate[:&lt;options&gt;])</emphasis>
</term>
<listitem>
<simpara>
ref names with custom decorations. The <emphasis>decorate</emphasis> string may be followed by a
colon and zero or more comma-separated options. Option values may contain
literal formatting codes. These must be used for commas (<emphasis>%x2C</emphasis>) and closing
parentheses (<emphasis>%x29</emphasis>), due to their role in the option syntax.
</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>prefix=&lt;value&gt;</emphasis>: Shown before the list of ref names.  Defaults to "&#160;<emphasis>(</emphasis>".
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>suffix=&lt;value&gt;</emphasis>: Shown after the list of ref names.  Defaults to "<emphasis>)</emphasis>".
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>separator=&lt;value&gt;</emphasis>: Shown between ref names.  Defaults to "<emphasis>,</emphasis>&#160;".
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>pointer=&lt;value&gt;</emphasis>: Shown between HEAD and the branch it points to, if any.
                      Defaults to "&#160;<emphasis>-&gt;</emphasis>&#160;".
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>tag=&lt;value&gt;</emphasis>: Shown before tag names. Defaults to "<emphasis>tag:</emphasis>&#160;".
</simpara>
</listitem>
</itemizedlist>
<simpara>For example, to produce decorations with no wrapping
or tag annotations, and spaces as separators:</simpara>
<simpara><emphasis>%(decorate:prefix=,suffix=,tag=,separator= )</emphasis></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%(describe[:&lt;options&gt;])</emphasis>
</term>
<listitem>
<simpara>
human-readable name, like <xref linkend="git-describe(1)" />; empty string for
undescribable commits.  The <emphasis>describe</emphasis> string may be followed by a colon and
zero or more comma-separated options.  Descriptions can be inconsistent when
tags are added or removed at the same time.
</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>tags[=&lt;bool-value&gt;]</emphasis>: Instead of only considering annotated tags,
   consider lightweight tags as well.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>abbrev=&lt;number&gt;</emphasis>: Instead of using the default number of hexadecimal digits
   (which will vary according to the number of objects in the repository with a
   default of 7) of the abbreviated object name, use &lt;number&gt; digits, or as many
   digits as needed to form a unique object name.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>match=&lt;pattern&gt;</emphasis>: Only consider tags matching the given
   <emphasis>glob(7)</emphasis> pattern, excluding the "refs/tags/" prefix.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>exclude=&lt;pattern&gt;</emphasis>: Do not consider tags matching the given
   <emphasis>glob(7)</emphasis> pattern, excluding the "refs/tags/" prefix.
</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%S</emphasis>
</term>
<listitem>
<simpara>
ref name given on the command line by which the commit was reached
       (like <emphasis>git log --source</emphasis>), only works with <emphasis>git log</emphasis>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%e</emphasis>
</term>
<listitem>
<simpara>
encoding
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%s</emphasis>
</term>
<listitem>
<simpara>
subject
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%f</emphasis>
</term>
<listitem>
<simpara>
sanitized subject line, suitable for a filename
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%b</emphasis>
</term>
<listitem>
<simpara>
body
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%B</emphasis>
</term>
<listitem>
<simpara>
raw body (unwrapped subject and body)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%GG</emphasis>
</term>
<listitem>
<simpara>
raw verification message from GPG for a signed commit
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%G?</emphasis>
</term>
<listitem>
<simpara>
show "G" for a good (valid) signature,
        "B" for a bad signature,
        "U" for a good signature with unknown validity,
        "X" for a good signature that has expired,
        "Y" for a good signature made by an expired key,
        "R" for a good signature made by a revoked key,
        "E" if the signature cannot be checked (e.g. missing key)
        and "N" for no signature
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%GS</emphasis>
</term>
<listitem>
<simpara>
show the name of the signer for a signed commit
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%GK</emphasis>
</term>
<listitem>
<simpara>
show the key used to sign a signed commit
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%GF</emphasis>
</term>
<listitem>
<simpara>
show the fingerprint of the key used to sign a signed commit
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%GP</emphasis>
</term>
<listitem>
<simpara>
show the fingerprint of the primary key whose subkey was used
        to sign a signed commit
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%GT</emphasis>
</term>
<listitem>
<simpara>
show the trust level for the key used to sign a signed commit
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%gD</emphasis>
</term>
<listitem>
<simpara>
reflog selector, e.g., <emphasis>refs/stash@{1}</emphasis> or <emphasis>refs/stash@{2
        minutes ago}</emphasis>; the format follows the rules described for the
        <emphasis>-g</emphasis> option. The portion before the <emphasis>@</emphasis> is the refname as
        given on the command line (so <emphasis>git log -g refs/heads/master</emphasis>
        would yield <emphasis>refs/heads/master@{0}</emphasis>).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%gd</emphasis>
</term>
<listitem>
<simpara>
shortened reflog selector; same as <emphasis>%gD</emphasis>, but the refname
        portion is shortened for human readability (so
        <emphasis>refs/heads/master</emphasis> becomes just <emphasis>master</emphasis>).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%gn</emphasis>
</term>
<listitem>
<simpara>
reflog identity name
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%gN</emphasis>
</term>
<listitem>
<simpara>
reflog identity name (respecting .mailmap, see
        <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%ge</emphasis>
</term>
<listitem>
<simpara>
reflog identity email
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%gE</emphasis>
</term>
<listitem>
<simpara>
reflog identity email (respecting .mailmap, see
        <xref linkend="git-shortlog(1)" /> or <xref linkend="git-blame(1)" />)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%gs</emphasis>
</term>
<listitem>
<simpara>
reflog subject
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>%(trailers[:&lt;options&gt;])</emphasis>
</term>
<listitem>
<simpara>
display the trailers of the body as interpreted by
<xref linkend="git-interpret-trailers(1)" />. The <emphasis>trailers</emphasis> string may be followed by
a colon and zero or more comma-separated options. If any option is provided
multiple times, the last occurrence wins.
</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>key=&lt;key&gt;</emphasis>: only show trailers with specified &lt;key&gt;. Matching is done
   case-insensitively and trailing colon is optional. If option is
   given multiple times trailer lines matching any of the keys are
   shown. This option automatically enables the <emphasis>only</emphasis> option so that
   non-trailer lines in the trailer block are hidden. If that is not
   desired it can be disabled with <emphasis>only=false</emphasis>.  E.g.,
   <emphasis>%(trailers:key=Reviewed-by)</emphasis> shows trailer lines with key
   <emphasis>Reviewed-by</emphasis>.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>only[=&lt;bool&gt;]</emphasis>: select whether non-trailer lines from the trailer
   block should be included.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>separator=&lt;sep&gt;</emphasis>: specify the separator inserted between trailer
   lines. Defaults to a line feed character. The string &lt;sep&gt; may contain
   the literal formatting codes described above. To use comma as
   separator one must use <emphasis>%x2C</emphasis> as it would otherwise be parsed as
   next option. E.g., <emphasis>%(trailers:key=Ticket,separator=%x2C )</emphasis>
   shows all trailer lines whose key is "Ticket" separated by a comma
   and a space.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>unfold[=&lt;bool&gt;]</emphasis>: make it behave as if interpret-trailer's <emphasis>--unfold</emphasis>
   option was given. E.g.,
   <emphasis>%(trailers:only,unfold=true)</emphasis> unfolds and shows all trailer lines.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>keyonly[=&lt;bool&gt;]</emphasis>: only show the key part of the trailer.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>valueonly[=&lt;bool&gt;]</emphasis>: only show the value part of the trailer.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>key_value_separator=&lt;sep&gt;</emphasis>: specify the separator inserted between
   the key and value of each trailer. Defaults to ": ". Otherwise it
   shares the same semantics as <emphasis>separator=&lt;sep&gt;</emphasis> above.
</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<note><simpara>Some placeholders may depend on other options given to the
revision traversal engine. For example, the <emphasis>%g*</emphasis> reflog options will
insert an empty string unless we are traversing reflog entries (e.g., by
<emphasis>git log -g</emphasis>). The <emphasis>%d</emphasis> and <emphasis>%D</emphasis> placeholders will use the "short"
decoration format if <emphasis>--decorate</emphasis> was not already provided on the command
line.</simpara></note>
<simpara>The boolean options accept an optional value <emphasis>[=&lt;bool-value&gt;]</emphasis>. The values
<emphasis>true</emphasis>, <emphasis>false</emphasis>, <emphasis>on</emphasis>, <emphasis>off</emphasis> etc. are all accepted. See the "boolean"
sub-section in "EXAMPLES" in <xref linkend="git-config(1)" />. If a boolean
option is given with no value, it's enabled.</simpara>
<simpara>If you add a <emphasis>+</emphasis> (plus sign) after <emphasis>%</emphasis> of a placeholder, a line-feed
is inserted immediately before the expansion if and only if the
placeholder expands to a non-empty string.</simpara>
<simpara>If you add a <emphasis>-</emphasis> (minus sign) after <emphasis>%</emphasis> of a placeholder, all consecutive
line-feeds immediately preceding the expansion are deleted if and only if the
placeholder expands to an empty string.</simpara>
<simpara>If you add a ` ` (space) after <emphasis>%</emphasis> of a placeholder, a space
is inserted immediately before the expansion if and only if the
placeholder expands to a non-empty string.</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>tformat:</emphasis>
</simpara>
<simpara>The <emphasis>tformat:</emphasis> format works exactly like <emphasis>format:</emphasis>, except that it
provides "terminator" semantics instead of "separator" semantics. In
other words, each commit has the message terminator character (usually a
newline) appended, rather than a separator placed between entries.
This means that the final entry of a single-line format will be properly
terminated with a new line, just as the "oneline" format does.
For example:</simpara>
<screen>$ git log -2 --pretty=format:%h 4da45bef \
  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
4da45be
7134973 -- NO NEWLINE

$ git log -2 --pretty=tformat:%h 4da45bef \
  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
4da45be
7134973</screen>
<simpara>In addition, any unrecognized string that has a <emphasis>%</emphasis> in it is interpreted
as if it has <emphasis>tformat:</emphasis> in front of it.  For example, these two are
equivalent:</simpara>
<screen>$ git log -2 --pretty=tformat:%h 4da45bef
$ git log -2 --pretty=%h 4da45bef</screen>
</listitem>
</itemizedlist>
</simplesect>
<simplesect id="git-rev-list(1)__examples">
<title>EXAMPLES</title>
<itemizedlist>
<listitem>
<simpara>
Print the list of commits reachable from the current branch.
</simpara>
<screen>git rev-list HEAD</screen>
</listitem>
<listitem>
<simpara>
Print the list of commits on this branch, but not present in the
  upstream branch.
</simpara>
<screen>git rev-list @{upstream}..HEAD</screen>
</listitem>
<listitem>
<simpara>
Format commits with their author and commit message (see also the
  porcelain <xref linkend="git-log(1)" />).
</simpara>
<screen>git rev-list --format=medium HEAD</screen>
</listitem>
<listitem>
<simpara>
Format commits along with their diffs (see also the porcelain
  <xref linkend="git-log(1)" />, which can do this in a single process).
</simpara>
<screen>git rev-list HEAD |
git diff-tree --stdin --format=medium -p</screen>
</listitem>
<listitem>
<simpara>
Print the list of commits on the current branch that touched any
  file in the <emphasis>Documentation</emphasis> directory.
</simpara>
<screen>git rev-list HEAD -- Documentation/</screen>
</listitem>
<listitem>
<simpara>
Print the list of commits authored by you in the past year, on
  any branch, tag, or other ref.
</simpara>
<screen>git rev-list --author=you@example.com --since=1.year.ago --all</screen>
</listitem>
<listitem>
<simpara>
Print the list of objects reachable from the current branch (i.e., all
  commits and the blobs and trees they contain).
</simpara>
<screen>git rev-list --objects HEAD</screen>
</listitem>
<listitem>
<simpara>
Compare the disk size of all reachable objects, versus those
  reachable from reflogs, versus the total packed size. This can tell
  you whether running <emphasis>git repack -ad</emphasis> might reduce the repository size
  (by dropping unreachable objects), and whether expiring reflogs might
  help.
</simpara>
<screen># reachable objects
git rev-list --disk-usage --objects --all
# plus reflogs
git rev-list --disk-usage --objects --all --reflog
# total disk size used
du -c .git/objects/pack/*.pack .git/objects/??/*
# alternative to du: add up "size" and "size-pack" fields
git count-objects -v</screen>
</listitem>
<listitem>
<simpara>
Report the disk size of each branch, not including objects used by the
  current branch. This can find outliers that are contributing to a
  bloated repository size (e.g., because somebody accidentally committed
  large build artifacts).
</simpara>
<screen>git for-each-ref --format='%(refname)' |
while read branch
do
        size=$(git rev-list --disk-usage --objects HEAD..$branch)
        echo "$size $branch"
done |
sort -n</screen>
</listitem>
<listitem>
<simpara>
Compare the on-disk size of branches in one group of refs, excluding
  another. If you co-mingle objects from multiple remotes in a single
  repository, this can show which remotes are contributing to the
  repository size (taking the size of <emphasis>origin</emphasis> as a baseline).
</simpara>
<screen>git rev-list --disk-usage --objects --remotes=$suspect --not --remotes=origin</screen>
</listitem>
</itemizedlist>
</simplesect>
<simplesect id="git-rev-list(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
