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

<sect2 lang="en" id="git-log(1)">
    <title>git-log(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>git-log(1)</primary>
</indexterm>
<simplesect id="git-log(1)__name">
<title>NAME</title>
<simpara>git-log - Show commit logs</simpara>
</simplesect>
<simplesect id="git-log(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git log</emphasis> [&lt;options&gt;] [&lt;revision-range&gt;] [[--] &lt;path&gt;&#8230;]</literallayout>
</blockquote>
</simplesect>
<simplesect id="git-log(1)__description">
<title>DESCRIPTION</title>
<simpara>Shows the commit logs.</simpara>
<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 log 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 log origin..HEAD
$ git log 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 log A B --not $(git merge-base --all A B)
$ git log A...B</screen>
<simpara>The command takes options applicable to the <xref linkend="git-rev-list(1)" />
command to control what is shown and how, and options applicable to
the <xref linkend="git-diff(1)" /> command to control how the changes
each commit introduces are shown.</simpara>
</simplesect>
<simplesect id="git-log(1)__options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
--follow
</term>
<listitem>
<simpara>
        Continue listing the history of a file beyond renames
        (works only for a single file).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-decorate
</term>
<term>
--decorate[=short|full|auto|no]
</term>
<listitem>
<simpara>
        Print out the ref names of any commits that are shown. If <emphasis>short</emphasis> is
        specified, the ref name prefixes <emphasis>refs/heads/</emphasis>, <emphasis>refs/tags/</emphasis> and
        <emphasis>refs/remotes/</emphasis> will not be printed. If <emphasis>full</emphasis> is specified, the
        full ref name (including prefix) will be printed. If <emphasis>auto</emphasis> is
        specified, then if the output is going to a terminal, the ref names
        are shown as if <emphasis>short</emphasis> were given, otherwise no ref names are
        shown. The option <emphasis>--decorate</emphasis> is short-hand for <emphasis>--decorate=short</emphasis>.
        Default to configuration value of <emphasis>log.decorate</emphasis> if configured,
        otherwise, <emphasis>auto</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--decorate-refs=&lt;pattern&gt;
</term>
<term>
--decorate-refs-exclude=&lt;pattern&gt;
</term>
<listitem>
<simpara>
        For each candidate reference, do not use it for decoration if it
        matches any patterns given to <emphasis>--decorate-refs-exclude</emphasis> or if it
        doesn't match any of the patterns given to <emphasis>--decorate-refs</emphasis>. The
        <emphasis>log.excludeDecoration</emphasis> config option allows excluding refs from
        the decorations, but an explicit <emphasis>--decorate-refs</emphasis> pattern will
        override a match in <emphasis>log.excludeDecoration</emphasis>.
</simpara>
<simpara>If none of these options or config settings are given, then references are
used as decoration if they match <emphasis>HEAD</emphasis>, <emphasis>refs/heads/</emphasis>, <emphasis>refs/remotes/</emphasis>,
<emphasis>refs/stash/</emphasis>, or <emphasis>refs/tags/</emphasis>.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--clear-decorations
</term>
<listitem>
<simpara>
        When specified, this option clears all previous <emphasis>--decorate-refs</emphasis>
        or <emphasis>--decorate-refs-exclude</emphasis> options and relaxes the default
        decoration filter to include all references. This option is
        assumed if the config value <emphasis>log.initialDecorationSet</emphasis> is set to
        <emphasis>all</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--source
</term>
<listitem>
<simpara>
        Print out the ref name given on the command line by which each
        commit was reached.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--[no-]mailmap
</term>
<term>
--[no-]use-mailmap
</term>
<listitem>
<simpara>
        Use mailmap file to map author and committer names and email
        addresses to canonical real names and email addresses. See
        <xref linkend="git-shortlog(1)" />.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--full-diff
</term>
<listitem>
<simpara>
        Without this flag, <emphasis>git log -p &lt;path&gt;...</emphasis> shows commits that
        touch the specified paths, and diffs about the same specified
        paths.  With this, the full diff is shown for commits that touch
        the specified paths; this means that "&lt;path&gt;&#8230;" limits only
        commits, and doesn't limit diff for those commits.
</simpara>
<simpara>Note that this affects all diff-based output types, e.g. those
produced by <emphasis>--stat</emphasis>, etc.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--log-size
</term>
<listitem>
<simpara>
        Include a line log size &lt;number&gt; in the output for each commit,
        where &lt;number&gt; is the length of that commit's message in bytes.
        Intended to speed up tools that read log messages from <emphasis>git log</emphasis>
        output by allowing them to allocate space in advance.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-L&lt;start&gt;,&lt;end&gt;:&lt;file&gt;
</term>
<term>
-L:&lt;funcname&gt;:&lt;file&gt;
</term>
<listitem>
<simpara>
        Trace the evolution of the line range given by <emphasis>&lt;start&gt;,&lt;end&gt;</emphasis>,
        or by the function name regex <emphasis>&lt;funcname&gt;</emphasis>, within the <emphasis>&lt;file&gt;</emphasis>. You may
        not give any pathspec limiters.  This is currently limited to
        a walk starting from a single revision, i.e., you may only
        give zero or one positive revision arguments, and
        <emphasis>&lt;start&gt;</emphasis> and <emphasis>&lt;end&gt;</emphasis> (or <emphasis>&lt;funcname&gt;</emphasis>) must exist in the starting revision.
        You can specify this option more than once. Implies <emphasis>--patch</emphasis>.
        Patch output can be suppressed using <emphasis>--no-patch</emphasis>, but other diff formats
        (namely <emphasis>--raw</emphasis>, <emphasis>--numstat</emphasis>, <emphasis>--shortstat</emphasis>, <emphasis>--dirstat</emphasis>, <emphasis>--summary</emphasis>,
        <emphasis>--name-only</emphasis>, <emphasis>--name-status</emphasis>, <emphasis>--check</emphasis>) are not currently implemented.
</simpara>
<simpara><emphasis>&lt;start&gt;</emphasis> and <emphasis>&lt;end&gt;</emphasis> can take one of these forms:</simpara>
<itemizedlist>
<listitem>
<simpara>
number
</simpara>
<simpara>If <emphasis>&lt;start&gt;</emphasis> or <emphasis>&lt;end&gt;</emphasis> is a number, it specifies an
absolute line number (lines count from 1).</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>/regex/</emphasis>
</simpara>
<simpara>This form will use the first line matching the given
POSIX regex. If <emphasis>&lt;start&gt;</emphasis> is a regex, it will search from the end of
the previous <emphasis>-L</emphasis> range, if any, otherwise from the start of file.
If <emphasis>&lt;start&gt;</emphasis> is <emphasis>^/regex/</emphasis>, it will search from the start of file.
If <emphasis>&lt;end&gt;</emphasis> is a regex, it will search
starting at the line given by <emphasis>&lt;start&gt;</emphasis>.</simpara>
</listitem>
<listitem>
<simpara>
+offset or -offset
</simpara>
<simpara>This is only valid for <emphasis>&lt;end&gt;</emphasis> and will specify a number
of lines before or after the line given by <emphasis>&lt;start&gt;</emphasis>.</simpara>
</listitem>
</itemizedlist>
<simpara>If <emphasis>:&lt;funcname&gt;</emphasis> is given in place of <emphasis>&lt;start&gt;</emphasis> and <emphasis>&lt;end&gt;</emphasis>, it is a
regular expression that denotes the range from the first funcname line
that matches <emphasis>&lt;funcname&gt;</emphasis>, up to the next funcname line. <emphasis>:&lt;funcname&gt;</emphasis>
searches from the end of the previous <emphasis>-L</emphasis> range, if any, otherwise
from the start of file. <emphasis>^:&lt;funcname&gt;</emphasis> searches from the start of
file. The function names are determined in the same way as <emphasis>git diff</emphasis>
works out patch hunk headers (see <emphasis>Defining a custom hunk-header</emphasis>
in <xref linkend="gitattributes(5)" />).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
&lt;revision-range&gt;
</term>
<listitem>
<simpara>
        Show only commits in the specified revision range.  When no
        &lt;revision-range&gt; is specified, it defaults to <emphasis>HEAD</emphasis> (i.e. the
        whole history leading to the current commit).  <emphasis>origin..HEAD</emphasis>
        specifies all the commits reachable from the current commit
        (i.e. <emphasis>HEAD</emphasis>), but not from <emphasis>origin</emphasis>. For a complete list of
        ways to spell &lt;revision-range&gt;, see the <emphasis>Specifying Ranges</emphasis>
        section of <xref linkend="gitrevisions(7)" />.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
[--] &lt;path&gt;&#8230;
</term>
<listitem>
<simpara>
        Show only commits that are enough to explain how the files
        that match the specified paths came to be.  See <emphasis>History
        Simplification</emphasis> below for details and other simplification
        modes.
</simpara>
<simpara>Paths may need to be prefixed with <emphasis>--</emphasis> to separate them from
options or the revision range, when confusion arises.</simpara>
</listitem>
</varlistentry>
</variablelist>
<section id="git-log(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>
--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>
<simpara>When <emphasis>--notes</emphasis> is in effect, the message from the notes is
matched as if it were part of the log message.</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>
<simpara>This option also changes default diff format for merge commits
to <emphasis>first-parent</emphasis>, see <emphasis>--diff-merges=first-parent</emphasis> for details.</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>
--bisect
</term>
<listitem>
<simpara>
        Pretend as if the bad bisection ref <emphasis>refs/bisect/bad</emphasis>
        was listed and as if it was followed by <emphasis>--not</emphasis> and the good
        bisection refs <emphasis>refs/bisect/good-*</emphasis> on the command
        line.
</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>
--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>
</variablelist>
</section>
<section id="git-log(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-log(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-log(1)__object_traversal">
<title>Object Traversal</title>
<simpara>These options are mostly targeted for packing of Git repositories.</simpara>
<variablelist>
<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-log(1)__commit_formatting">
<title>Commit Formatting</title>
<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>
--notes[=&lt;ref&gt;]
</term>
<listitem>
<simpara>
        Show the notes (see <xref linkend="git-notes(1)" />) that annotate the
        commit, when showing the commit log message.  This is the default
        for <emphasis>git log</emphasis>, <emphasis>git show</emphasis> and <emphasis>git whatchanged</emphasis> commands when
        there is no <emphasis>--pretty</emphasis>, <emphasis>--format</emphasis>, or <emphasis>--oneline</emphasis> option given
        on the command line.
</simpara>
<simpara>By default, the notes shown are from the notes refs listed in the
<emphasis>core.notesRef</emphasis> and <emphasis>notes.displayRef</emphasis> variables (or corresponding
environment overrides). See <xref linkend="git-config(1)" /> for more details.</simpara>
<simpara>With an optional <emphasis>&lt;ref&gt;</emphasis> argument, use the ref to find the notes
to display.  The ref can specify the full refname when it begins
with <emphasis>refs/notes/</emphasis>; when it begins with <emphasis>notes/</emphasis>, <emphasis>refs/</emphasis> and otherwise
<emphasis>refs/notes/</emphasis> is prefixed to form the full name of the ref.</simpara>
<simpara>Multiple --notes options can be combined to control which notes are
being displayed. Examples: "--notes=foo" will show only notes from
"refs/notes/foo"; "--notes=foo --notes" will show both notes from
"refs/notes/foo" and from the default notes ref(s).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-notes
</term>
<listitem>
<simpara>
        Do not show notes. This negates the above <emphasis>--notes</emphasis> option, by
        resetting the list of notes refs from which notes are shown.
        Options are parsed in the order given on the command line, so e.g.
        "--notes --notes=foo --no-notes --notes=bar" will only show notes
        from "refs/notes/bar".
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--show-notes-by-default
</term>
<listitem>
<simpara>
        Show the default notes unless options for displaying specific
        notes are given.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--show-notes[=&lt;ref&gt;]
</term>
<term>
--[no-]standard-notes
</term>
<listitem>
<simpara>
        These options are deprecated. Use the above --notes/--no-notes
        options instead.
</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>
--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>
--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>
</variablelist>
</section>
</simplesect>
<simplesect id="git-log(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>%N</emphasis>
</term>
<listitem>
<simpara>
commit notes
</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-log(1)__diff_formatting">
<title>DIFF FORMATTING</title>
<simpara>By default, <emphasis>git log</emphasis> does not generate any diff output. The options
below can be used to show the changes made by each commit.</simpara>
<simpara>Note that unless one of <emphasis>--diff-merges</emphasis> variants (including short
<emphasis>-m</emphasis>, <emphasis>-c</emphasis>, <emphasis>--cc</emphasis>, and <emphasis>--dd</emphasis> options) is explicitly given, merge commits
will not show a diff, even if a diff format like <emphasis>--patch</emphasis> is
selected, nor will they match search options like <emphasis>-S</emphasis>. The exception
is when <emphasis>--first-parent</emphasis> is in use, in which case <emphasis>first-parent</emphasis> is
the default format for merge commits.</simpara>
<variablelist>
<varlistentry>
<term>
-p
</term>
<term>
-u
</term>
<term>
--patch
</term>
<listitem>
<simpara>
        Generate patch (see <xref linkend="git-log(1)_generate_patch_text_with_p"/>).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-s
</term>
<term>
--no-patch
</term>
<listitem>
<simpara>
        Suppress all output from the diff machinery.  Useful for
        commands like <emphasis>git show</emphasis> that show the patch by default to
        squelch their output, or to cancel the effect of options like
        <emphasis>--patch</emphasis>, <emphasis>--stat</emphasis> earlier on the command line in an alias.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-m
</term>
<listitem>
<simpara>
        Show diffs for merge commits in the default format. This is
        similar to <emphasis>--diff-merges=on</emphasis>, except <emphasis>-m</emphasis> will
        produce no output unless <emphasis>-p</emphasis> is given as well.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-c
</term>
<listitem>
<simpara>
        Produce combined diff output for merge commits.
        Shortcut for <emphasis>--diff-merges=combined -p</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--cc
</term>
<listitem>
<simpara>
        Produce dense combined diff output for merge commits.
        Shortcut for <emphasis>--diff-merges=dense-combined -p</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--dd
</term>
<listitem>
<simpara>
        Produce diff with respect to first parent for both merge and
        regular commits.
        Shortcut for <emphasis>--diff-merges=first-parent -p</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--remerge-diff
</term>
<listitem>
<simpara>
        Produce remerge-diff output for merge commits.
        Shortcut for <emphasis>--diff-merges=remerge -p</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-diff-merges
</term>
<listitem>
<simpara>
        Synonym for <emphasis>--diff-merges=off</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--diff-merges=&lt;format&gt;
</term>
<listitem>
<simpara>
        Specify diff format to be used for merge commits. Default is
        <emphasis>off</emphasis> unless <emphasis>--first-parent</emphasis> is in use, in
        which case <emphasis>first-parent</emphasis> is the default.
</simpara>
<simpara>The following formats are supported:</simpara>
<variablelist>
<varlistentry>
<term>
off, none
</term>
<listitem>
<simpara>
        Disable output of diffs for merge commits. Useful to override
        implied value.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
on, m
</term>
<listitem>
<simpara>
        Make diff output for merge commits to be shown in the default
        format. The default format can be changed using
        <emphasis>log.diffMerges</emphasis> configuration variable, whose default value
        is <emphasis>separate</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
first-parent, 1
</term>
<listitem>
<simpara>
        Show full diff with respect to first parent. This is the same
        format as <emphasis>--patch</emphasis> produces for non-merge commits.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
separate
</term>
<listitem>
<simpara>
        Show full diff with respect to each of parents.
        Separate log entry and diff is generated for each parent.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
combined, c
</term>
<listitem>
<simpara>
        Show differences from each of the parents to the merge
        result simultaneously instead of showing pairwise diff between
        a parent and the result one at a time. Furthermore, it lists
        only files which were modified from all parents.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
dense-combined, cc
</term>
<listitem>
<simpara>
        Further compress output produced by <emphasis>--diff-merges=combined</emphasis>
        by omitting uninteresting hunks whose contents in the parents
        have only two variants and the merge result picks one of them
        without modification.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
remerge, r
</term>
<listitem>
<simpara>
        Remerge two-parent merge commits to create a temporary tree
        object--potentially containing files with conflict markers
        and such.  A diff is then shown between that temporary tree
        and the actual merge commit.
</simpara>
<simpara>The output emitted when this option is used is subject to change, and
so is its interaction with other options (unless explicitly
documented).</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term>
--combined-all-paths
</term>
<listitem>
<simpara>
        This flag causes combined diffs (used for merge commits) to
        list the name of the file from all parents.  It thus only has
        effect when <emphasis>--diff-merges=[dense-]combined</emphasis> is in use, and
        is likely only useful if filename changes are detected (i.e.
        when either rename or copy detection have been requested).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-U&lt;n&gt;
</term>
<term>
--unified=&lt;n&gt;
</term>
<listitem>
<simpara>
        Generate diffs with &lt;n&gt; lines of context instead of
        the usual three.
        Implies <emphasis>--patch</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--output=&lt;file&gt;
</term>
<listitem>
<simpara>
        Output to a specific file instead of stdout.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--output-indicator-new=&lt;char&gt;
</term>
<term>
--output-indicator-old=&lt;char&gt;
</term>
<term>
--output-indicator-context=&lt;char&gt;
</term>
<listitem>
<simpara>
        Specify the character used to indicate new, old or context
        lines in the generated patch. Normally they are <emphasis>+</emphasis>, <emphasis>-</emphasis> and
        ' ' respectively.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--raw
</term>
<listitem>
<simpara>
        For each commit, show a summary of changes using the raw diff
        format. See the "RAW OUTPUT FORMAT" section of
        <xref linkend="git-diff(1)" />. This is different from showing the log
        itself in raw format, which you can achieve with
        <emphasis>--format=raw</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--patch-with-raw
</term>
<listitem>
<simpara>
        Synonym for <emphasis>-p --raw</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-t
</term>
<listitem>
<simpara>
        Show the tree objects in the diff output.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--indent-heuristic
</term>
<listitem>
<simpara>
        Enable the heuristic that shifts diff hunk boundaries to make patches
        easier to read. This is the default.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-indent-heuristic
</term>
<listitem>
<simpara>
        Disable the indent heuristic.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--minimal
</term>
<listitem>
<simpara>
        Spend extra time to make sure the smallest possible
        diff is produced.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--patience
</term>
<listitem>
<simpara>
        Generate a diff using the "patience diff" algorithm.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--histogram
</term>
<listitem>
<simpara>
        Generate a diff using the "histogram diff" algorithm.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--anchored=&lt;text&gt;
</term>
<listitem>
<simpara>
        Generate a diff using the "anchored diff" algorithm.
</simpara>
<simpara>This option may be specified more than once.</simpara>
<simpara>If a line exists in both the source and destination, exists only once,
and starts with this text, this algorithm attempts to prevent it from
appearing as a deletion or addition in the output. It uses the "patience
diff" algorithm internally.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--diff-algorithm={patience|minimal|histogram|myers}
</term>
<listitem>
<simpara>
        Choose a diff algorithm. The variants are as follows:
</simpara>
<variablelist>
<varlistentry>
<term>
<emphasis>default</emphasis>, <emphasis>myers</emphasis>
</term>
<listitem>
<simpara>
        The basic greedy diff algorithm. Currently, this is the default.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>minimal</emphasis>
</term>
<listitem>
<simpara>
        Spend extra time to make sure the smallest possible diff is
        produced.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>patience</emphasis>
</term>
<listitem>
<simpara>
        Use "patience diff" algorithm when generating patches.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>histogram</emphasis>
</term>
<listitem>
<simpara>
        This algorithm extends the patience algorithm to "support
        low-occurrence common elements".
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>For instance, if you configured the <emphasis>diff.algorithm</emphasis> variable to a
non-default value and want to use the default one, then you
have to use <emphasis>--diff-algorithm=default</emphasis> option.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]
</term>
<listitem>
<simpara>
        Generate a diffstat. By default, as much space as necessary
        will be used for the filename part, and the rest for the graph
        part. Maximum width defaults to terminal width, or 80 columns
        if not connected to a terminal, and can be overridden by
        <emphasis>&lt;width&gt;</emphasis>. The width of the filename part can be limited by
        giving another width <emphasis>&lt;name-width&gt;</emphasis> after a comma or by setting
        <emphasis>diff.statNameWidth=&lt;width&gt;</emphasis>. The width of the graph part can be
        limited by using <emphasis>--stat-graph-width=&lt;width&gt;</emphasis> or by setting
        <emphasis>diff.statGraphWidth=&lt;width&gt;</emphasis>. Using <emphasis>--stat</emphasis> or
        <emphasis>--stat-graph-width</emphasis> affects all commands generating a stat graph,
        while setting <emphasis>diff.statNameWidth</emphasis> or <emphasis>diff.statGraphWidth</emphasis>
        does not affect <emphasis>git format-patch</emphasis>.
        By giving a third parameter <emphasis>&lt;count&gt;</emphasis>, you can limit the output to
        the first <emphasis>&lt;count&gt;</emphasis> lines, followed by <emphasis>...</emphasis> if there are more.
</simpara>
<simpara>These parameters can also be set individually with <emphasis>--stat-width=&lt;width&gt;</emphasis>,
<emphasis>--stat-name-width=&lt;name-width&gt;</emphasis> and <emphasis>--stat-count=&lt;count&gt;</emphasis>.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--compact-summary
</term>
<listitem>
<simpara>
        Output a condensed summary of extended header information such
        as file creations or deletions ("new" or "gone", optionally "+l"
        if it's a symlink) and mode changes ("+x" or "-x" for adding
        or removing executable bit respectively) in diffstat. The
        information is put between the filename part and the graph
        part. Implies <emphasis>--stat</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--numstat
</term>
<listitem>
<simpara>
        Similar to <emphasis>--stat</emphasis>, but shows number of added and
        deleted lines in decimal notation and pathname without
        abbreviation, to make it more machine friendly.  For
        binary files, outputs two <emphasis>-</emphasis> instead of saying
        <emphasis>0 0</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--shortstat
</term>
<listitem>
<simpara>
        Output only the last line of the <emphasis>--stat</emphasis> format containing total
        number of modified files, as well as number of added and deleted
        lines.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-X[&lt;param1,param2,&#8230;&gt;]
</term>
<term>
--dirstat[=&lt;param1,param2,&#8230;&gt;]
</term>
<listitem>
<simpara>
        Output the distribution of relative amount of changes for each
        sub-directory. The behavior of <emphasis>--dirstat</emphasis> can be customized by
        passing it a comma separated list of parameters.
        The defaults are controlled by the <emphasis>diff.dirstat</emphasis> configuration
        variable (see <xref linkend="git-config(1)" />).
        The following parameters are available:
</simpara>
<variablelist>
<varlistentry>
<term>
<emphasis>changes</emphasis>
</term>
<listitem>
<simpara>
        Compute the dirstat numbers by counting the lines that have been
        removed from the source, or added to the destination. This ignores
        the amount of pure code movements within a file.  In other words,
        rearranging lines in a file is not counted as much as other changes.
        This is the default behavior when no parameter is given.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>lines</emphasis>
</term>
<listitem>
<simpara>
        Compute the dirstat numbers by doing the regular line-based diff
        analysis, and summing the removed/added line counts. (For binary
        files, count 64-byte chunks instead, since binary files have no
        natural concept of lines). This is a more expensive <emphasis>--dirstat</emphasis>
        behavior than the <emphasis>changes</emphasis> behavior, but it does count rearranged
        lines within a file as much as other changes. The resulting output
        is consistent with what you get from the other <emphasis>--*stat</emphasis> options.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>files</emphasis>
</term>
<listitem>
<simpara>
        Compute the dirstat numbers by counting the number of files changed.
        Each changed file counts equally in the dirstat analysis. This is
        the computationally cheapest <emphasis>--dirstat</emphasis> behavior, since it does
        not have to look at the file contents at all.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>cumulative</emphasis>
</term>
<listitem>
<simpara>
        Count changes in a child directory for the parent directory as well.
        Note that when using <emphasis>cumulative</emphasis>, the sum of the percentages
        reported may exceed 100%. The default (non-cumulative) behavior can
        be specified with the <emphasis>noncumulative</emphasis> parameter.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
&lt;limit&gt;
</term>
<listitem>
<simpara>
        An integer parameter specifies a cut-off percent (3% by default).
        Directories contributing less than this percentage of the changes
        are not shown in the output.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>Example: The following will count changed files, while ignoring
directories with less than 10% of the total amount of changed files,
and accumulating child directory counts in the parent directories:
<emphasis>--dirstat=files,10,cumulative</emphasis>.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--cumulative
</term>
<listitem>
<simpara>
        Synonym for --dirstat=cumulative
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--dirstat-by-file[=&lt;param1,param2&gt;&#8230;]
</term>
<listitem>
<simpara>
        Synonym for --dirstat=files,&lt;param1&gt;,&lt;param2&gt;&#8230;
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--summary
</term>
<listitem>
<simpara>
        Output a condensed summary of extended header information
        such as creations, renames and mode changes.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--patch-with-stat
</term>
<listitem>
<simpara>
        Synonym for <emphasis>-p --stat</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-z
</term>
<listitem>
<simpara>
        Separate the commits with NULs instead of newlines.
</simpara>
<simpara>Also, when <emphasis>--raw</emphasis> or <emphasis>--numstat</emphasis> has been given, do not munge
pathnames and use NULs as output field terminators.</simpara>
<simpara>Without this option, pathnames with "unusual" characters are quoted as
explained for the configuration variable <emphasis>core.quotePath</emphasis> (see
<xref linkend="git-config(1)" />).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--name-only
</term>
<listitem>
<simpara>
        Show only the name of each changed file in the post-image tree.
        The file names are often encoded in UTF-8.
        For more information see the discussion about encoding in the <xref linkend="git-log(1)" />
        manual page.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--name-status
</term>
<listitem>
<simpara>
        Show only the name(s) and status of each changed file. See the description
        of the <emphasis>--diff-filter</emphasis> option on what the status letters mean.
        Just like <emphasis>--name-only</emphasis> the file names are often encoded in UTF-8.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--submodule[=&lt;format&gt;]
</term>
<listitem>
<simpara>
        Specify how differences in submodules are shown.  When specifying
        <emphasis>--submodule=short</emphasis> the <emphasis>short</emphasis> format is used.  This format just
        shows the names of the commits at the beginning and end of the range.
        When <emphasis>--submodule</emphasis> or <emphasis>--submodule=log</emphasis> is specified, the <emphasis>log</emphasis>
        format is used.  This format lists the commits in the range like
        <xref linkend="git-submodule(1)" /> <emphasis>summary</emphasis> does.  When <emphasis>--submodule=diff</emphasis>
        is specified, the <emphasis>diff</emphasis> format is used.  This format shows an
        inline diff of the changes in the submodule contents between the
        commit range.  Defaults to <emphasis>diff.submodule</emphasis> or the <emphasis>short</emphasis> format
        if the config option is unset.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--color[=&lt;when&gt;]
</term>
<listitem>
<simpara>
        Show colored diff.
        <emphasis>--color</emphasis> (i.e. without <emphasis>=&lt;when&gt;</emphasis>) is the same as <emphasis>--color=always</emphasis>.
        <emphasis>&lt;when&gt;</emphasis> can be one of <emphasis>always</emphasis>, <emphasis>never</emphasis>, or <emphasis>auto</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-color
</term>
<listitem>
<simpara>
        Turn off colored diff.
        It is the same as <emphasis>--color=never</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--color-moved[=&lt;mode&gt;]
</term>
<listitem>
<simpara>
        Moved lines of code are colored differently.
        The &lt;mode&gt; defaults to <emphasis>no</emphasis> if the option is not given
        and to <emphasis>zebra</emphasis> if the option with no mode is given.
        The mode must be one of:
</simpara>
<variablelist>
<varlistentry>
<term>
no
</term>
<listitem>
<simpara>
        Moved lines are not highlighted.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
default
</term>
<listitem>
<simpara>
        Is a synonym for <emphasis>zebra</emphasis>. This may change to a more sensible mode
        in the future.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
plain
</term>
<listitem>
<simpara>
        Any line that is added in one location and was removed
        in another location will be colored with <emphasis>color.diff.newMoved</emphasis>.
        Similarly <emphasis>color.diff.oldMoved</emphasis> will be used for removed lines
        that are added somewhere else in the diff. This mode picks up any
        moved line, but it is not very useful in a review to determine
        if a block of code was moved without permutation.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
blocks
</term>
<listitem>
<simpara>
        Blocks of moved text of at least 20 alphanumeric characters
        are detected greedily. The detected blocks are
        painted using either the <emphasis>color.diff.{old,new}Moved</emphasis> color.
        Adjacent blocks cannot be told apart.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
zebra
</term>
<listitem>
<simpara>
        Blocks of moved text are detected as in <emphasis>blocks</emphasis> mode. The blocks
        are painted using either the <emphasis>color.diff.{old,new}Moved</emphasis> color or
        <emphasis>color.diff.{old,new}MovedAlternative</emphasis>. The change between
        the two colors indicates that a new block was detected.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
dimmed-zebra
</term>
<listitem>
<simpara>
        Similar to <emphasis>zebra</emphasis>, but additional dimming of uninteresting parts
        of moved code is performed. The bordering lines of two adjacent
        blocks are considered interesting, the rest is uninteresting.
        <emphasis>dimmed_zebra</emphasis> is a deprecated synonym.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-color-moved
</term>
<listitem>
<simpara>
        Turn off move detection. This can be used to override configuration
        settings. It is the same as <emphasis>--color-moved=no</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--color-moved-ws=&lt;modes&gt;
</term>
<listitem>
<simpara>
        This configures how whitespace is ignored when performing the
        move detection for <emphasis>--color-moved</emphasis>.
        These modes can be given as a comma separated list:
</simpara>
<variablelist>
<varlistentry>
<term>
no
</term>
<listitem>
<simpara>
        Do not ignore whitespace when performing move detection.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
ignore-space-at-eol
</term>
<listitem>
<simpara>
        Ignore changes in whitespace at EOL.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
ignore-space-change
</term>
<listitem>
<simpara>
        Ignore changes in amount of whitespace.  This ignores whitespace
        at line end, and considers all other sequences of one or
        more whitespace characters to be equivalent.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
ignore-all-space
</term>
<listitem>
<simpara>
        Ignore whitespace when comparing lines. This ignores differences
        even if one line has whitespace where the other line has none.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
allow-indentation-change
</term>
<listitem>
<simpara>
        Initially ignore any whitespace in the move detection, then
        group the moved code blocks only into a block if the change in
        whitespace is the same per line. This is incompatible with the
        other modes.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-color-moved-ws
</term>
<listitem>
<simpara>
        Do not ignore whitespace when performing move detection. This can be
        used to override configuration settings. It is the same as
        <emphasis>--color-moved-ws=no</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--word-diff[=&lt;mode&gt;]
</term>
<listitem>
<simpara>
        Show a word diff, using the &lt;mode&gt; to delimit changed words.
        By default, words are delimited by whitespace; see
        <emphasis>--word-diff-regex</emphasis> below.  The &lt;mode&gt; defaults to <emphasis>plain</emphasis>, and
        must be one of:
</simpara>
<variablelist>
<varlistentry>
<term>
color
</term>
<listitem>
<simpara>
        Highlight changed words using only colors.  Implies <emphasis>--color</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
plain
</term>
<listitem>
<simpara>
        Show words as <emphasis>[-removed-]</emphasis> and <emphasis>{+added+}</emphasis>.  Makes no
        attempts to escape the delimiters if they appear in the input,
        so the output may be ambiguous.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
porcelain
</term>
<listitem>
<simpara>
        Use a special line-based format intended for script
        consumption.  Added/removed/unchanged runs are printed in the
        usual unified diff format, starting with a <emphasis>+</emphasis>/<emphasis>-</emphasis>/` `
        character at the beginning of the line and extending to the
        end of the line.  Newlines in the input are represented by a
        tilde <emphasis>~</emphasis> on a line of its own.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
none
</term>
<listitem>
<simpara>
        Disable word diff again.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>Note that despite the name of the first mode, color is used to
highlight the changed parts in all modes if enabled.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--word-diff-regex=&lt;regex&gt;
</term>
<listitem>
<simpara>
        Use &lt;regex&gt; to decide what a word is, instead of considering
        runs of non-whitespace to be a word.  Also implies
        <emphasis>--word-diff</emphasis> unless it was already enabled.
</simpara>
<simpara>Every non-overlapping match of the
&lt;regex&gt; is considered a word.  Anything between these matches is
considered whitespace and ignored(!) for the purposes of finding
differences.  You may want to append <emphasis>|[^[:space:]]</emphasis> to your regular
expression to make sure that it matches all non-whitespace characters.
A match that contains a newline is silently truncated(!) at the
newline.</simpara>
<simpara>For example, <emphasis>--word-diff-regex=.</emphasis> will treat each character as a word
and, correspondingly, show differences character by character.</simpara>
<simpara>The regex can also be set via a diff driver or configuration option, see
<xref linkend="gitattributes(5)" /> or <xref linkend="git-config(1)" />.  Giving it explicitly
overrides any diff driver or configuration setting.  Diff drivers
override configuration settings.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--color-words[=&lt;regex&gt;]
</term>
<listitem>
<simpara>
        Equivalent to <emphasis>--word-diff=color</emphasis> plus (if a regex was
        specified) <emphasis>--word-diff-regex=&lt;regex&gt;</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-renames
</term>
<listitem>
<simpara>
        Turn off rename detection, even when the configuration
        file gives the default to do so.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--[no-]rename-empty
</term>
<listitem>
<simpara>
        Whether to use empty blobs as rename source.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--check
</term>
<listitem>
<simpara>
        Warn if changes introduce conflict markers or whitespace errors.
        What are considered whitespace errors is controlled by <emphasis>core.whitespace</emphasis>
        configuration.  By default, trailing whitespaces (including
        lines that consist solely of whitespaces) and a space character
        that is immediately followed by a tab character inside the
        initial indent of the line are considered whitespace errors.
        Exits with non-zero status if problems are found. Not compatible
        with --exit-code.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ws-error-highlight=&lt;kind&gt;
</term>
<listitem>
<simpara>
        Highlight whitespace errors in the <emphasis>context</emphasis>, <emphasis>old</emphasis> or <emphasis>new</emphasis>
        lines of the diff.  Multiple values are separated by comma,
        <emphasis>none</emphasis> resets previous values, <emphasis>default</emphasis> reset the list to
        <emphasis>new</emphasis> and <emphasis>all</emphasis> is a shorthand for <emphasis>old,new,context</emphasis>.  When
        this option is not given, and the configuration variable
        <emphasis>diff.wsErrorHighlight</emphasis> is not set, only whitespace errors in
        <emphasis>new</emphasis> lines are highlighted. The whitespace errors are colored
        with <emphasis>color.diff.whitespace</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--full-index
</term>
<listitem>
<simpara>
        Instead of the first handful of characters, show the full
        pre- and post-image blob object names on the "index"
        line when generating patch format output.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--binary
</term>
<listitem>
<simpara>
        In addition to <emphasis>--full-index</emphasis>, output a binary diff that
        can be applied with <emphasis>git-apply</emphasis>.
        Implies <emphasis>--patch</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--abbrev[=&lt;n&gt;]
</term>
<listitem>
<simpara>
        Instead of showing the full 40-byte hexadecimal object
        name in diff-raw format output and diff-tree header
        lines, show the shortest prefix that is at least <emphasis>&lt;n&gt;</emphasis>
        hexdigits long that uniquely refers the object.
        In diff-patch output format, <emphasis>--full-index</emphasis> takes higher
        precedence, i.e. if <emphasis>--full-index</emphasis> is specified, full blob
        names will be shown regardless of <emphasis>--abbrev</emphasis>.
        Non default number of digits can be specified with <emphasis>--abbrev=&lt;n&gt;</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-B[&lt;n&gt;][/&lt;m&gt;]
</term>
<term>
--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]
</term>
<listitem>
<simpara>
        Break complete rewrite changes into pairs of delete and
        create. This serves two purposes:
</simpara>
<simpara>It affects the way a change that amounts to a total rewrite of a file
not as a series of deletion and insertion mixed together with a very
few lines that happen to match textually as the context, but as a
single deletion of everything old followed by a single insertion of
everything new, and the number <emphasis>m</emphasis> controls this aspect of the -B
option (defaults to 60%). <emphasis>-B/70%</emphasis> specifies that less than 30% of the
original should remain in the result for Git to consider it a total
rewrite (i.e. otherwise the resulting patch will be a series of
deletion and insertion mixed together with context lines).</simpara>
<simpara>When used with -M, a totally-rewritten file is also considered as the
source of a rename (usually -M only considers a file that disappeared
as the source of a rename), and the number <emphasis>n</emphasis> controls this aspect of
the -B option (defaults to 50%). <emphasis>-B20%</emphasis> specifies that a change with
addition and deletion compared to 20% or more of the file's size are
eligible for being picked up as a possible source of a rename to
another file.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-M[&lt;n&gt;]
</term>
<term>
--find-renames[=&lt;n&gt;]
</term>
<listitem>
<simpara>
        If generating diffs, detect and report renames for each commit.
        For following files across renames while traversing history, see
        <emphasis>--follow</emphasis>.
        If <emphasis>n</emphasis> is specified, it is a threshold on the similarity
        index (i.e. amount of addition/deletions compared to the
        file's size). For example, <emphasis>-M90%</emphasis> means Git should consider a
        delete/add pair to be a rename if more than 90% of the file
        hasn't changed.  Without a <emphasis>%</emphasis> sign, the number is to be read as
        a fraction, with a decimal point before it.  I.e., <emphasis>-M5</emphasis> becomes
        0.5, and is thus the same as <emphasis>-M50%</emphasis>.  Similarly, <emphasis>-M05</emphasis> is
        the same as <emphasis>-M5%</emphasis>.  To limit detection to exact renames, use
        <emphasis>-M100%</emphasis>.  The default similarity index is 50%.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-C[&lt;n&gt;]
</term>
<term>
--find-copies[=&lt;n&gt;]
</term>
<listitem>
<simpara>
        Detect copies as well as renames.  See also <emphasis>--find-copies-harder</emphasis>.
        If <emphasis>n</emphasis> is specified, it has the same meaning as for <emphasis>-M&lt;n&gt;</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--find-copies-harder
</term>
<listitem>
<simpara>
        For performance reasons, by default, <emphasis>-C</emphasis> option finds copies only
        if the original file of the copy was modified in the same
        changeset.  This flag makes the command
        inspect unmodified files as candidates for the source of
        copy.  This is a very expensive operation for large
        projects, so use it with caution.  Giving more than one
        <emphasis>-C</emphasis> option has the same effect.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-D
</term>
<term>
--irreversible-delete
</term>
<listitem>
<simpara>
        Omit the preimage for deletes, i.e. print only the header but not
        the diff between the preimage and <emphasis>/dev/null</emphasis>. The resulting patch
        is not meant to be applied with <emphasis>patch</emphasis> or <emphasis>git apply</emphasis>; this is
        solely for people who want to just concentrate on reviewing the
        text after the change. In addition, the output obviously lacks
        enough information to apply such a patch in reverse, even manually,
        hence the name of the option.
</simpara>
<simpara>When used together with <emphasis>-B</emphasis>, omit also the preimage in the deletion part
of a delete/create pair.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-l&lt;num&gt;
</term>
<listitem>
<simpara>
        The <emphasis>-M</emphasis> and <emphasis>-C</emphasis> options involve some preliminary steps that
        can detect subsets of renames/copies cheaply, followed by an
        exhaustive fallback portion that compares all remaining
        unpaired destinations to all relevant sources.  (For renames,
        only remaining unpaired sources are relevant; for copies, all
        original sources are relevant.)  For N sources and
        destinations, this exhaustive check is O(N^2).  This option
        prevents the exhaustive portion of rename/copy detection from
        running if the number of source/destination files involved
        exceeds the specified number.  Defaults to diff.renameLimit.
        Note that a value of 0 is treated as unlimited.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;[*]]
</term>
<listitem>
<simpara>
        Select only files that are Added (<emphasis>A</emphasis>), Copied (<emphasis>C</emphasis>),
        Deleted (<emphasis>D</emphasis>), Modified (<emphasis>M</emphasis>), Renamed (<emphasis>R</emphasis>), have their
        type (i.e. regular file, symlink, submodule, &#8230;) changed (<emphasis>T</emphasis>),
        are Unmerged (<emphasis>U</emphasis>), are
        Unknown (<emphasis>X</emphasis>), or have had their pairing Broken (<emphasis>B</emphasis>).
        Any combination of the filter characters (including none) can be used.
        When <emphasis>*</emphasis> (All-or-none) is added to the combination, all
        paths are selected if there is any file that matches
        other criteria in the comparison; if there is no file
        that matches other criteria, nothing is selected.
</simpara>
<simpara>Also, these upper-case letters can be downcased to exclude.  E.g.
<emphasis>--diff-filter=ad</emphasis> excludes added and deleted paths.</simpara>
<simpara>Note that not all diffs can feature all types. For instance, copied and
renamed entries cannot appear if detection for those types is disabled.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-S&lt;string&gt;
</term>
<listitem>
<simpara>
        Look for differences that change the number of occurrences of
        the specified string (i.e. addition/deletion) in a file.
        Intended for the scripter's use.
</simpara>
<simpara>It is useful when you're looking for an exact block of code (like a
struct), and want to know the history of that block since it first
came into being: use the feature iteratively to feed the interesting
block in the preimage back into <emphasis>-S</emphasis>, and keep going until you get the
very first version of the block.</simpara>
<simpara>Binary files are searched as well.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-G&lt;regex&gt;
</term>
<listitem>
<simpara>
        Look for differences whose patch text contains added/removed
        lines that match &lt;regex&gt;.
</simpara>
<simpara>To illustrate the difference between <emphasis>-S&lt;regex&gt; --pickaxe-regex</emphasis> and
<emphasis>-G&lt;regex&gt;</emphasis>, consider a commit with the following diff in the same
file:</simpara>
<screen>+    return frotz(nitfol, two-&gt;ptr, 1, 0);
...
-    hit = frotz(nitfol, mf2.ptr, 1, 0);</screen>
<simpara>While <emphasis>git log -G"frotz\(nitfol"</emphasis> will show this commit, <emphasis>git log
-S"frotz\(nitfol" --pickaxe-regex</emphasis> will not (because the number of
occurrences of that string did not change).</simpara>
<simpara>Unless <emphasis>--text</emphasis> is supplied patches of binary files without a textconv
filter will be ignored.</simpara>
<simpara>See the <emphasis>pickaxe</emphasis> entry in <xref linkend="gitdiffcore(7)" /> for more
information.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--find-object=&lt;object-id&gt;
</term>
<listitem>
<simpara>
        Look for differences that change the number of occurrences of
        the specified object. Similar to <emphasis>-S</emphasis>, just the argument is different
        in that it doesn't search for a specific string but for a specific
        object id.
</simpara>
<simpara>The object can be a blob or a submodule commit. It implies the <emphasis>-t</emphasis> option in
<emphasis>git-log</emphasis> to also find trees.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--pickaxe-all
</term>
<listitem>
<simpara>
        When <emphasis>-S</emphasis> or <emphasis>-G</emphasis> finds a change, show all the changes in that
        changeset, not just the files that contain the change
        in &lt;string&gt;.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--pickaxe-regex
</term>
<listitem>
<simpara>
        Treat the &lt;string&gt; given to <emphasis>-S</emphasis> as an extended POSIX regular
        expression to match.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-O&lt;orderfile&gt;
</term>
<listitem>
<simpara>
        Control the order in which files appear in the output.
        This overrides the <emphasis>diff.orderFile</emphasis> configuration variable
        (see <xref linkend="git-config(1)" />).  To cancel <emphasis>diff.orderFile</emphasis>,
        use <emphasis>-O/dev/null</emphasis>.
</simpara>
<simpara>The output order is determined by the order of glob patterns in
&lt;orderfile&gt;.
All files with pathnames that match the first pattern are output
first, all files with pathnames that match the second pattern (but not
the first) are output next, and so on.
All files with pathnames that do not match any pattern are output
last, as if there was an implicit match-all pattern at the end of the
file.
If multiple pathnames have the same rank (they match the same pattern
but no earlier patterns), their output order relative to each other is
the normal order.</simpara>
<simpara>&lt;orderfile&gt; is parsed as follows:</simpara>
<itemizedlist>
<listitem>
<simpara>
Blank lines are ignored, so they can be used as separators for
   readability.
</simpara>
</listitem>
<listitem>
<simpara>
Lines starting with a hash ("<emphasis>#</emphasis>") are ignored, so they can be used
   for comments.  Add a backslash ("<emphasis>\</emphasis>") to the beginning of the
   pattern if it starts with a hash.
</simpara>
</listitem>
<listitem>
<simpara>
Each other line contains a single pattern.
</simpara>
</listitem>
</itemizedlist>
<simpara>Patterns have the same syntax and semantics as patterns used for
fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
matches a pattern if removing any number of the final pathname
components matches the pattern.  For example, the pattern "<emphasis>foo*bar</emphasis>"
matches "<emphasis>fooasdfbar</emphasis>" and "<emphasis>foo/bar/baz/asdf</emphasis>" but not "<emphasis>foobarx</emphasis>".</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--skip-to=&lt;file&gt;
</term>
<term>
--rotate-to=&lt;file&gt;
</term>
<listitem>
<simpara>
        Discard the files before the named &lt;file&gt; from the output
        (i.e. <emphasis>skip to</emphasis>), or move them to the end of the output
        (i.e. <emphasis>rotate to</emphasis>).  These options were invented primarily for the use
        of the <emphasis>git difftool</emphasis> command, and may not be very useful
        otherwise.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-R
</term>
<listitem>
<simpara>
        Swap two inputs; that is, show differences from index or
        on-disk file to tree contents.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--relative[=&lt;path&gt;]
</term>
<term>
--no-relative
</term>
<listitem>
<simpara>
        When run from a subdirectory of the project, it can be
        told to exclude changes outside the directory and show
        pathnames relative to it with this option.  When you are
        not in a subdirectory (e.g. in a bare repository), you
        can name which subdirectory to make the output relative
        to by giving a &lt;path&gt; as an argument.
        <emphasis>--no-relative</emphasis> can be used to countermand both <emphasis>diff.relative</emphasis> config
        option and previous <emphasis>--relative</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-a
</term>
<term>
--text
</term>
<listitem>
<simpara>
        Treat all files as text.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ignore-cr-at-eol
</term>
<listitem>
<simpara>
        Ignore carriage-return at the end of line when doing a comparison.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ignore-space-at-eol
</term>
<listitem>
<simpara>
        Ignore changes in whitespace at EOL.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-b
</term>
<term>
--ignore-space-change
</term>
<listitem>
<simpara>
        Ignore changes in amount of whitespace.  This ignores whitespace
        at line end, and considers all other sequences of one or
        more whitespace characters to be equivalent.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-w
</term>
<term>
--ignore-all-space
</term>
<listitem>
<simpara>
        Ignore whitespace when comparing lines.  This ignores
        differences even if one line has whitespace where the other
        line has none.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ignore-blank-lines
</term>
<listitem>
<simpara>
        Ignore changes whose lines are all blank.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-I&lt;regex&gt;
</term>
<term>
--ignore-matching-lines=&lt;regex&gt;
</term>
<listitem>
<simpara>
        Ignore changes whose all lines match &lt;regex&gt;.  This option may
        be specified more than once.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--inter-hunk-context=&lt;lines&gt;
</term>
<listitem>
<simpara>
        Show the context between diff hunks, up to the specified number
        of lines, thereby fusing hunks that are close to each other.
        Defaults to <emphasis>diff.interHunkContext</emphasis> or 0 if the config option
        is unset.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-W
</term>
<term>
--function-context
</term>
<listitem>
<simpara>
        Show whole function as context lines for each change.
        The function names are determined in the same way as
        <emphasis>git diff</emphasis> works out patch hunk headers (see <emphasis>Defining a
        custom hunk-header</emphasis> in <xref linkend="gitattributes(5)" />).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ext-diff
</term>
<listitem>
<simpara>
        Allow an external diff helper to be executed. If you set an
        external diff driver with <xref linkend="gitattributes(5)" />, you need
        to use this option with <xref linkend="git-log(1)" /> and friends.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-ext-diff
</term>
<listitem>
<simpara>
        Disallow external diff drivers.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--textconv
</term>
<term>
--no-textconv
</term>
<listitem>
<simpara>
        Allow (or disallow) external text conversion filters to be run
        when comparing binary files. See <xref linkend="gitattributes(5)" /> for
        details. Because textconv filters are typically a one-way
        conversion, the resulting diff is suitable for human
        consumption, but cannot be applied. For this reason, textconv
        filters are enabled by default only for <xref linkend="git-diff(1)" /> and
        <xref linkend="git-log(1)" />, but not for <xref linkend="git-format-patch(1)" /> or
        diff plumbing commands.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ignore-submodules[=&lt;when&gt;]
</term>
<listitem>
<simpara>
        Ignore changes to submodules in the diff generation. &lt;when&gt; can be
        either "none", "untracked", "dirty" or "all", which is the default.
        Using "none" will consider the submodule modified when it either contains
        untracked or modified files or its HEAD differs from the commit recorded
        in the superproject and can be used to override any settings of the
        <emphasis>ignore</emphasis> option in <xref linkend="git-config(1)" /> or <xref linkend="gitmodules(5)" />. When
        "untracked" is used submodules are not considered dirty when they only
        contain untracked content (but they are still scanned for modified
        content). Using "dirty" ignores all changes to the work tree of submodules,
        only changes to the commits stored in the superproject are shown (this was
        the behavior until 1.7.0). Using "all" hides all changes to submodules.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--src-prefix=&lt;prefix&gt;
</term>
<listitem>
<simpara>
        Show the given source prefix instead of "a/".
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--dst-prefix=&lt;prefix&gt;
</term>
<listitem>
<simpara>
        Show the given destination prefix instead of "b/".
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--no-prefix
</term>
<listitem>
<simpara>
        Do not show any source or destination prefix.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--default-prefix
</term>
<listitem>
<simpara>
        Use the default source and destination prefixes ("a/" and "b/").
        This overrides configuration variables such as <emphasis>diff.noprefix</emphasis>,
        <emphasis>diff.srcPrefix</emphasis>, <emphasis>diff.dstPrefix</emphasis>, and <emphasis>diff.mnemonicPrefix</emphasis>
        (see <emphasis>git-config</emphasis>(1)).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--line-prefix=&lt;prefix&gt;
</term>
<listitem>
<simpara>
        Prepend an additional prefix to every line of output.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ita-invisible-in-index
</term>
<listitem>
<simpara>
        By default entries added by "git add -N" appear as an existing
        empty file in "git diff" and a new file in "git diff --cached".
        This option makes the entry appear as a new file in "git diff"
        and non-existent in "git diff --cached". This option could be
        reverted with <emphasis>--ita-visible-in-index</emphasis>. Both options are
        experimental and could be removed in future.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>For more detailed explanation on these common options, see also
<xref linkend="gitdiffcore(7)" />.</simpara>
</simplesect>
<simplesect id="git-log(1)_generate_patch_text_with_p">
<title>Generating patch text with -p</title>
<simpara>Running
<xref linkend="git-diff(1)" />,
<xref linkend="git-log(1)" />,
<xref linkend="git-show(1)" />,
<xref linkend="git-diff-index(1)" />,
<xref linkend="git-diff-tree(1)" />, or
<xref linkend="git-diff-files(1)" />
with the <emphasis>-p</emphasis> option produces patch text.
You can customize the creation of patch text via the
<emphasis>GIT_EXTERNAL_DIFF</emphasis> and the <emphasis>GIT_DIFF_OPTS</emphasis> environment variables
(see <xref linkend="git(1)" />), and the <emphasis>diff</emphasis> attribute (see <xref linkend="gitattributes(5)" />).</simpara>
<simpara>What the -p option produces is slightly different from the traditional
diff format:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>
It is preceded by a "git diff" header that looks like this:
</simpara>
<literallayout class="monospaced">diff --git a/file1 b/file2</literallayout>
<simpara>The <emphasis>a/</emphasis> and <emphasis>b/</emphasis> filenames are the same unless rename/copy is
involved.  Especially, even for a creation or a deletion,
<emphasis>/dev/null</emphasis> is <emphasis>not</emphasis> used in place of the <emphasis>a/</emphasis> or <emphasis>b/</emphasis> filenames.</simpara>
<simpara>When a rename/copy is involved, <emphasis>file1</emphasis> and <emphasis>file2</emphasis> show the
name of the source file of the rename/copy and the name of
the file that the rename/copy produces, respectively.</simpara>
</listitem>
<listitem>
<simpara>
It is followed by one or more extended header lines:
</simpara>
<literallayout class="monospaced">old mode &lt;mode&gt;
new mode &lt;mode&gt;
deleted file mode &lt;mode&gt;
new file mode &lt;mode&gt;
copy from &lt;path&gt;
copy to &lt;path&gt;
rename from &lt;path&gt;
rename to &lt;path&gt;
similarity index &lt;number&gt;
dissimilarity index &lt;number&gt;
index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</literallayout>
<simpara>File modes are printed as 6-digit octal numbers including the file type
and file permission bits.</simpara>
<simpara>Path names in extended headers do not include the <emphasis>a/</emphasis> and <emphasis>b/</emphasis> prefixes.</simpara>
<simpara>The similarity index is the percentage of unchanged lines, and
the dissimilarity index is the percentage of changed lines.  It
is a rounded down integer, followed by a percent sign.  The
similarity index value of 100% is thus reserved for two equal
files, while 100% dissimilarity means that no line from the old
file made it into the new one.</simpara>
<simpara>The index line includes the blob object names before and after the change.
The &lt;mode&gt; is included if the file mode does not change; otherwise,
separate lines indicate the old and the new mode.</simpara>
</listitem>
<listitem>
<simpara>
Pathnames with "unusual" characters are quoted as explained for
    the configuration variable <emphasis>core.quotePath</emphasis> (see
    <xref linkend="git-config(1)" />).
</simpara>
</listitem>
<listitem>
<simpara>
All the <emphasis>file1</emphasis> files in the output refer to files before the
    commit, and all the <emphasis>file2</emphasis> files refer to files after the commit.
    It is incorrect to apply each change to each file sequentially.  For
    example, this patch will swap a and b:
</simpara>
<literallayout class="monospaced">diff --git a/a b/b
rename from a
rename to b
diff --git a/b b/a
rename from b
rename to a</literallayout>
</listitem>
<listitem>
<simpara>
Hunk headers mention the name of the function to which the hunk
    applies.  See "Defining a custom hunk-header" in
    <xref linkend="gitattributes(5)" /> for details of how to tailor this to
    specific languages.
</simpara>
</listitem>
</orderedlist>
</simplesect>
<simplesect id="git-log(1)__combined_diff_format">
<title>Combined diff format</title>
<simpara>Any diff-generating command can take the <emphasis>-c</emphasis> or <emphasis>--cc</emphasis> option to
produce a <emphasis>combined diff</emphasis> when showing a merge. This is the default
format when showing merges with <xref linkend="git-diff(1)" /> or
<xref linkend="git-show(1)" />. Note also that you can give suitable
<emphasis>--diff-merges</emphasis> option to any of these commands to force generation of
diffs in a specific format.</simpara>
<simpara>A "combined diff" format looks like this:</simpara>
<screen>diff --combined describe.c
index fabadb8,cc95eb0..4866510
--- a/describe.c
+++ b/describe.c
@@@ -98,20 -98,12 +98,20 @@@
        return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
  }

- static void describe(char *arg)
 -static void describe(struct commit *cmit, int last_one)
++static void describe(char *arg, int last_one)
  {
 +      unsigned char sha1[20];
 +      struct commit *cmit;
        struct commit_list *list;
        static int initialized = 0;
        struct commit_name *n;

 +      if (get_sha1(arg, sha1) &lt; 0)
 +              usage(describe_usage);
 +      cmit = lookup_commit_reference(sha1);
 +      if (!cmit)
 +              usage(describe_usage);
 +
        if (!initialized) {
                initialized = 1;
                for_each_ref(get_name);</screen>
<orderedlist numeration="arabic">
<listitem>
<simpara>
It is preceded by a "git diff" header, that looks like
     this (when the <emphasis>-c</emphasis> option is used):
</simpara>
<literallayout class="monospaced">diff --combined file</literallayout>
<simpara>or like this (when the <emphasis>--cc</emphasis> option is used):</simpara>
<literallayout class="monospaced">diff --cc file</literallayout>
</listitem>
<listitem>
<simpara>
It is followed by one or more extended header lines
     (this example shows a merge with two parents):
</simpara>
<literallayout class="monospaced">index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
new file mode &lt;mode&gt;
deleted file mode &lt;mode&gt;,&lt;mode&gt;</literallayout>
<simpara>The <emphasis>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</emphasis> line appears only if at least one of
the &lt;mode&gt; is different from the rest. Extended headers with
information about detected content movement (renames and
copying detection) are designed to work with the diff of two
&lt;tree-ish&gt; and are not used by combined diff format.</simpara>
</listitem>
<listitem>
<simpara>
It is followed by a two-line from-file/to-file header:
</simpara>
<literallayout class="monospaced">--- a/file
+++ b/file</literallayout>
<simpara>Similar to the two-line header for the traditional <emphasis>unified</emphasis> diff
format, <emphasis>/dev/null</emphasis> is used to signal created or deleted
files.</simpara>
<simpara>However, if the --combined-all-paths option is provided, instead of a
two-line from-file/to-file, you get an N+1 line from-file/to-file header,
where N is the number of parents in the merge commit:</simpara>
<literallayout class="monospaced">--- a/file
--- a/file
--- a/file
+++ b/file</literallayout>
<simpara>This extended format can be useful if rename or copy detection is
active, to allow you to see the original name of the file in different
parents.</simpara>
</listitem>
<listitem>
<simpara>
Chunk header format is modified to prevent people from
     accidentally feeding it to <emphasis>patch -p1</emphasis>. Combined diff format
     was created for review of merge commit changes, and was not
     meant to be applied. The change is similar to the change in the
     extended <emphasis>index</emphasis> header:
</simpara>
<literallayout class="monospaced">@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</literallayout>
<simpara>There are (number of parents + 1) <emphasis>@</emphasis> characters in the chunk
header for combined diff format.</simpara>
</listitem>
</orderedlist>
<simpara>Unlike the traditional <emphasis>unified</emphasis> diff format, which shows two
files A and B with a single column that has <emphasis>-</emphasis> (minus --
appears in A but removed in B), <emphasis>+</emphasis> (plus -- missing in A but
added to B), or <emphasis>" "</emphasis> (space -- unchanged) prefix, this format
compares two or more files file1, file2,&#8230; with one file X, and
shows how X differs from each of fileN.  One column for each of
fileN is prepended to the output line to note how X's line is
different from it.</simpara>
<simpara>A <emphasis>-</emphasis> character in the column N means that the line appears in
fileN but it does not appear in the result.  A <emphasis>+</emphasis> character
in the column N means that the line appears in the result,
and fileN does not have that line (in other words, the line was
added, from the point of view of that parent).</simpara>
<simpara>In the above example output, the function signature was changed
from both files (hence two <emphasis>-</emphasis> removals from both file1 and
file2, plus <emphasis>++</emphasis> to mean one line that was added does not appear
in either file1 or file2).  Also, eight other lines are the same
from file1 but do not appear in file2 (hence prefixed with <emphasis>+</emphasis>).</simpara>
<simpara>When shown by <emphasis>git diff-tree -c</emphasis>, it compares the parents of a
merge commit with the merge result (i.e. file1..fileN are the
parents).  When shown by <emphasis>git diff-files -c</emphasis>, it compares the
two unresolved merge parents with the working tree file
(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
"their version").</simpara>
</simplesect>
<simplesect id="git-log(1)__examples">
<title>EXAMPLES</title>
<variablelist>
<varlistentry>
<term>
<emphasis>git log --no-merges</emphasis>
</term>
<listitem>
<simpara>
        Show the whole commit history, but skip any merges
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log v2.6.12.. include/scsi drivers/scsi</emphasis>
</term>
<listitem>
<simpara>
        Show all commits since version <emphasis>v2.6.12</emphasis> that changed any file
        in the <emphasis>include/scsi</emphasis> or <emphasis>drivers/scsi</emphasis> subdirectories
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log --since="2 weeks ago" -- gitk</emphasis>
</term>
<listitem>
<simpara>
        Show the changes during the last two weeks to the file <emphasis>gitk</emphasis>.
        The <emphasis>--</emphasis> is necessary to avoid confusion with the <emphasis role="strong">branch</emphasis> named
        <emphasis>gitk</emphasis>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log --name-status release..test</emphasis>
</term>
<listitem>
<simpara>
        Show the commits that are in the "test" branch but not yet
        in the "release" branch, along with the list of paths
        each commit modifies.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log --follow builtin/rev-list.c</emphasis>
</term>
<listitem>
<simpara>
        Shows the commits that changed <emphasis>builtin/rev-list.c</emphasis>, including
        those commits that occurred before the file was given its
        present name.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log --branches --not --remotes=origin</emphasis>
</term>
<listitem>
<simpara>
        Shows all commits that are in any of local branches but not in
        any of remote-tracking branches for <emphasis>origin</emphasis> (what you have that
        origin doesn't).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log master --not --remotes=*/master</emphasis>
</term>
<listitem>
<simpara>
        Shows all commits that are in local master but not in any remote
        repository master branches.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log -p -m --first-parent</emphasis>
</term>
<listitem>
<simpara>
        Shows the history including change diffs, but only from the
        main branch perspective, skipping commits that come from merged
        branches, and showing full diffs of changes introduced by the merges.
        This makes sense only when following a strict policy of merging all
        topic branches when staying on a single integration branch.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log -L '/int main/',/^}/:main.c</emphasis>
</term>
<listitem>
<simpara>
        Shows how the function <emphasis>main()</emphasis> in the file <emphasis>main.c</emphasis> evolved
        over time.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>git log -3</emphasis>
</term>
<listitem>
<simpara>
        Limits the number of commits to show to 3.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-log(1)__discussion">
<title>DISCUSSION</title>
<simpara>Git is to some extent character encoding agnostic.</simpara>
<itemizedlist>
<listitem>
<simpara>
The contents of the blob objects are uninterpreted sequences
   of bytes.  There is no encoding translation at the core
   level.
</simpara>
</listitem>
<listitem>
<simpara>
Path names are encoded in UTF-8 normalization form C. This
   applies to tree objects, the index file, ref names, as well as
   path names in command line arguments, environment variables
   and config files (<emphasis>.git/config</emphasis> (see <xref linkend="git-config(1)" />),
   <xref linkend="gitignore(5)" />, <xref linkend="gitattributes(5)" /> and
   <xref linkend="gitmodules(5)" />).
</simpara>
<simpara>Note that Git at the core level treats path names simply as
sequences of non-NUL bytes, there are no path name encoding
conversions (except on Mac and Windows). Therefore, using
non-ASCII path names will mostly work even on platforms and file
systems that use legacy extended ASCII encodings. However,
repositories created on such systems will not work properly on
UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
Additionally, many Git-based tools simply assume path names to
be UTF-8 and will fail to display other encodings correctly.</simpara>
</listitem>
<listitem>
<simpara>
Commit log messages are typically encoded in UTF-8, but other
   extended ASCII encodings are also supported. This includes
   ISO-8859-x, CP125x and many others, but <emphasis>not</emphasis> UTF-16/32,
   EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
   EUC-x, CP9xx etc.).
</simpara>
</listitem>
</itemizedlist>
<simpara>Although we encourage that the commit log messages are encoded
in UTF-8, both the core and Git Porcelain are designed not to
force UTF-8 on projects.  If all participants of a particular
project find it more convenient to use legacy encodings, Git
does not forbid it.  However, there are a few things to keep in
mind.</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>
<emphasis>git commit</emphasis> and <emphasis>git commit-tree</emphasis> issue
  a warning if the commit log message given to it does not look
  like a valid UTF-8 string, unless you explicitly say your
  project uses a legacy encoding.  The way to say this is to
  have <emphasis>i18n.commitEncoding</emphasis> in <emphasis>.git/config</emphasis> file, like this:
</simpara>
<screen>[i18n]
        commitEncoding = ISO-8859-1</screen>
<simpara>Commit objects created with the above setting record the value
of <emphasis>i18n.commitEncoding</emphasis> in their <emphasis>encoding</emphasis> header.  This is to
help other people who look at them later.  Lack of this header
implies that the commit log message is encoded in UTF-8.</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>git log</emphasis>, <emphasis>git show</emphasis>, <emphasis>git blame</emphasis> and friends look at the
  <emphasis>encoding</emphasis> header of a commit object, and try to re-code the
  log message into UTF-8 unless otherwise specified.  You can
  specify the desired output encoding with
  <emphasis>i18n.logOutputEncoding</emphasis> in <emphasis>.git/config</emphasis> file, like this:
</simpara>
<screen>[i18n]
        logOutputEncoding = ISO-8859-1</screen>
<simpara>If you do not have this configuration variable, the value of
<emphasis>i18n.commitEncoding</emphasis> is used instead.</simpara>
</listitem>
</orderedlist>
<simpara>Note that we deliberately chose not to re-code the commit log
message when a commit is made to force UTF-8 at the commit
object level, because re-coding to UTF-8 is not necessarily a
reversible operation.</simpara>
</simplesect>
<simplesect id="git-log(1)__configuration">
<title>CONFIGURATION</title>
<simpara>See <xref linkend="git-config(1)" /> for core variables and <xref linkend="git-diff(1)" />
for settings related to diff generation.</simpara>
<variablelist>
<varlistentry>
<term>
format.pretty
</term>
<listitem>
<simpara>
        Default for the <emphasis>--format</emphasis> option.  (See <emphasis>Pretty Formats</emphasis> above.)
        Defaults to <emphasis>medium</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
i18n.logOutputEncoding
</term>
<listitem>
<simpara>
        Encoding to use when displaying logs.  (See <emphasis>Discussion</emphasis> above.)
        Defaults to the value of <emphasis>i18n.commitEncoding</emphasis> if set, and UTF-8
        otherwise.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>Everything above this line in this section isn't included from the
<xref linkend="git-config(1)" /> documentation. The content that follows is the
same as what's found there:</simpara>
<variablelist>
<varlistentry>
<term>
log.abbrevCommit
</term>
<listitem>
<simpara>
        If true, makes <xref linkend="git-log(1)" />, <xref linkend="git-show(1)" />, and
        <xref linkend="git-whatchanged(1)" /> assume <emphasis>--abbrev-commit</emphasis>. You may
        override this option with <emphasis>--no-abbrev-commit</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.date
</term>
<listitem>
<simpara>
        Set the default date-time mode for the <emphasis>log</emphasis> command.
        Setting a value for log.date is similar to using <emphasis>git log</emphasis>'s
        <emphasis>--date</emphasis> option.  See <xref linkend="git-log(1)" /> for details.
</simpara>
<simpara>If the format is set to "auto:foo" and the pager is in use, format
"foo" will be used for the date format. Otherwise, "default" will
be used.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.decorate
</term>
<listitem>
<simpara>
        Print out the ref names of any commits that are shown by the log
        command. If <emphasis>short</emphasis> is specified, the ref name prefixes <emphasis>refs/heads/</emphasis>,
        <emphasis>refs/tags/</emphasis> and <emphasis>refs/remotes/</emphasis> will not be printed. If <emphasis>full</emphasis> is
        specified, the full ref name (including prefix) will be printed.
        If <emphasis>auto</emphasis> is specified, then if the output is going to a terminal,
        the ref names are shown as if <emphasis>short</emphasis> were given, otherwise no ref
        names are shown. This is the same as the <emphasis>--decorate</emphasis> option
        of the <emphasis>git log</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.initialDecorationSet
</term>
<listitem>
<simpara>
        By default, <emphasis>git log</emphasis> only shows decorations for certain known ref
        namespaces. If <emphasis>all</emphasis> is specified, then show all refs as
        decorations.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.excludeDecoration
</term>
<listitem>
<simpara>
        Exclude the specified patterns from the log decorations. This is
        similar to the <emphasis>--decorate-refs-exclude</emphasis> command-line option, but
        the config option can be overridden by the <emphasis>--decorate-refs</emphasis>
        option.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.diffMerges
</term>
<listitem>
<simpara>
        Set diff format to be used when <emphasis>--diff-merges=on</emphasis> is
        specified, see <emphasis>--diff-merges</emphasis> in <xref linkend="git-log(1)" /> for
        details. Defaults to <emphasis>separate</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.follow
</term>
<listitem>
<simpara>
        If <emphasis>true</emphasis>, <emphasis>git log</emphasis> will act as if the <emphasis>--follow</emphasis> option was used when
        a single &lt;path&gt; is given.  This has the same limitations as <emphasis>--follow</emphasis>,
        i.e. it cannot be used to follow multiple files and does not work well
        on non-linear history.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.graphColors
</term>
<listitem>
<simpara>
        A list of colors, separated by commas, that can be used to draw
        history lines in <emphasis>git log --graph</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.showRoot
</term>
<listitem>
<simpara>
        If true, the initial commit will be shown as a big creation event.
        This is equivalent to a diff against an empty tree.
        Tools like <xref linkend="git-log(1)" /> or <xref linkend="git-whatchanged(1)" />, which
        normally hide the root commit will now show it. True by default.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.showSignature
</term>
<listitem>
<simpara>
        If true, makes <xref linkend="git-log(1)" />, <xref linkend="git-show(1)" />, and
        <xref linkend="git-whatchanged(1)" /> assume <emphasis>--show-signature</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
log.mailmap
</term>
<listitem>
<simpara>
        If true, makes <xref linkend="git-log(1)" />, <xref linkend="git-show(1)" />, and
        <xref linkend="git-whatchanged(1)" /> assume <emphasis>--use-mailmap</emphasis>, otherwise
        assume <emphasis>--no-use-mailmap</emphasis>. True by default.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
notes.mergeStrategy
</term>
<listitem>
<simpara>
        Which merge strategy to choose by default when resolving notes
        conflicts.  Must be one of <emphasis>manual</emphasis>, <emphasis>ours</emphasis>, <emphasis>theirs</emphasis>, <emphasis>union</emphasis>, or
        <emphasis>cat_sort_uniq</emphasis>.  Defaults to <emphasis>manual</emphasis>.  See the "NOTES MERGE STRATEGIES"
        section of <xref linkend="git-notes(1)" /> for more information on each strategy.
</simpara>
<simpara>This setting can be overridden by passing the <emphasis>--strategy</emphasis> option to
<xref linkend="git-notes(1)" />.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
notes.&lt;name&gt;.mergeStrategy
</term>
<listitem>
<simpara>
        Which merge strategy to choose when doing a notes merge into
        refs/notes/&lt;name&gt;.  This overrides the more general
        "notes.mergeStrategy".  See the "NOTES MERGE STRATEGIES" section in
        <xref linkend="git-notes(1)" /> for more information on the available strategies.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
notes.displayRef
</term>
<listitem>
<simpara>
        Which ref (or refs, if a glob or specified more than once), in
        addition to the default set by <emphasis>core.notesRef</emphasis> or
        <emphasis>GIT_NOTES_REF</emphasis>, to read notes from when showing commit
        messages with the <emphasis>git log</emphasis> family of commands.
</simpara>
<simpara>This setting can be overridden with the <emphasis>GIT_NOTES_DISPLAY_REF</emphasis>
environment variable, which must be a colon separated list of refs or
globs.</simpara>
<simpara>A warning will be issued for refs that do not exist,
but a glob that does not match any refs is silently ignored.</simpara>
<simpara>This setting can be disabled by the <emphasis>--no-notes</emphasis> option to the <emphasis>git
log</emphasis> family of commands, or by the <emphasis>--notes=&lt;ref&gt;</emphasis> option accepted by
those commands.</simpara>
<simpara>The effective value of "core.notesRef" (possibly overridden by
GIT_NOTES_REF) is also implicitly added to the list of refs to be
displayed.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
notes.rewrite.&lt;command&gt;
</term>
<listitem>
<simpara>
        When rewriting commits with &lt;command&gt; (currently <emphasis>amend</emphasis> or
        <emphasis>rebase</emphasis>), if this variable is <emphasis>false</emphasis>, git will not copy
        notes from the original to the rewritten commit.  Defaults to
        <emphasis>true</emphasis>.  See also "<emphasis>notes.rewriteRef</emphasis>" below.
</simpara>
<simpara>This setting can be overridden with the <emphasis>GIT_NOTES_REWRITE_REF</emphasis>
environment variable, which must be a colon separated list of refs or
globs.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
notes.rewriteMode
</term>
<listitem>
<simpara>
        When copying notes during a rewrite (see the
        "notes.rewrite.&lt;command&gt;" option), determines what to do if
        the target commit already has a note.  Must be one of
        <emphasis>overwrite</emphasis>, <emphasis>concatenate</emphasis>, <emphasis>cat_sort_uniq</emphasis>, or <emphasis>ignore</emphasis>.
        Defaults to <emphasis>concatenate</emphasis>.
</simpara>
<simpara>This setting can be overridden with the <emphasis>GIT_NOTES_REWRITE_MODE</emphasis>
environment variable.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
notes.rewriteRef
</term>
<listitem>
<simpara>
        When copying notes during a rewrite, specifies the (fully
        qualified) ref whose notes should be copied.  May be a glob,
        in which case notes in all matching refs will be copied.  You
        may also specify this configuration several times.
</simpara>
<simpara>Does not have a default value; you must configure this variable to
enable note rewriting.  Set it to <emphasis>refs/notes/commits</emphasis> to enable
rewriting for the default commit notes.</simpara>
<simpara>Can be overridden with the <emphasis>GIT_NOTES_REWRITE_REF</emphasis> environment variable.
See <emphasis>notes.rewrite.&lt;command&gt;</emphasis> above for a further description of its format.</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-log(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
